Link to home
Start Free TrialLog in
Avatar of ronlinran
ronlinran

asked on

Grabbing highlighted nickname from Yahoo Chat window list

I'm writing some DELPHI 7 utilities for use with Yahoo Chat.  Sending output from my program into the Yahoo Chat window was tricky but rather painless.  However, I would now like to be able to grab the currently highlighted nickname from the room participant list for use in my program output.  Every version of SendMessage() using GETTEXT has failed when send to that nickname list window and I stumped.  Any solution?
ASKER CERTIFIED SOLUTION
Avatar of ccrdude
ccrdude

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ronlinran
ronlinran

ASKER

Okay, like I said, this problem has me compltetly puzzled.  I used the code provided by ccrdude but to no avail.  Sorry.

I have the handle of the chat room window using a call to findwindow using the 'imclass'.  Using Windowse spy program though I find that the class name of the nickname list is 'SysListView32'.  Using findwindowex with the 'imclass' window and then hooking to the 'SysListView32' window and then using the above code only returns 'List2' as the text not the actual text of the highlighted nickname in the list.  Hope that makes sense.

Anyway, thanks for trying
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nope, still no dice.  I"m about ready to give up on this even though I know it CAN be done.
I guess "List" is the name of the control, not the contents. GetText would work for listboxes, but I'm not sure about ListViews.

My idea: get the window handle.
Then do EnumChildWindows.
Print out GetClassName and GetWindowText for each handle that EnumChildWindows returns.
That way you should be able to find the correct classname of the control you're looking for.
Thanks for all the help to date.  The control I am trying to access the highlighted text from is indeed a ListView and that seems to be the tricky bit.  The windows API isn't someting I'm very experienced with so grabbing the currently highlighted text from the control is proving porblematic at best.  The handle to the control is something I have, just what to do with it beyond that to get the info I want is the problem.