Posted on 2003-02-21
Medium Priority
Last Modified: 2007-12-19

i want to read the text of the user at MSN Messenger Login dialog... it's a ComboBox.

Inside the window there's a class named 'SysCredential' and it's the parent for the combobox, but when i try to get its handle i do not success... here's part of the code

  wnd: HWND;


// Find Msgr Window
wnd := FindWindow('#32770', '.NET Messenger Service');

// Find 'SysCredential' window
wnd := FindWindowEx(wnd, 0, 'SysCredential', nil);

// **** THIS should give me the handle for the combobox, but it does not! :(
wnd := FindWindowEx(wnd 0, 'ComboBox', nil);

Please Help me!! what am i doing wrong????
btw... i got class names using Spy++
Question by:tearsoftragedy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Accepted Solution

BTecho earned 800 total points
ID: 7996597

Im not running XP at the moment so I have no way of testing your code snippet.

But in any case I would add some small modifications. Check if the HWND returned is not Zero before proceeding.

// Find Msgr Window
wnd := FindWindow('#32770', '.NET Messenger Service');

// Find 'SysCredential' window
if wnd<>0 then begin
wnd := FindWindowEx(wnd, 0, 'SysCredential', nil);

/***** THIS should give me the handle for the combobox, but it does not! :( */
 if wnd<>0 then begin
 wnd := FindWindowEx(wnd 0, 'ComboBox', nil);


I would then add breakpoints to each line where FindWindowEx is used, now run the snippet and see if it continues to each line FindWindowEx is and it should reach FindWindowEx(wnd 0, 'ComboBox', nil); if it does and there is only one such combobox on that form then you got the right handle, if not then I would recheck if gave the correct captions, becuase FindWindow is case sensitive.

I would suspect you really check the classname and window caption for this one and all the other classes and captions,
FindWindow('#32770', '.NET Messenger Service');

becuase I happen to find a snippet on the internet that shows this'
FindWindow('#32770', 'Messenger Service ');


Expert Comment

ID: 9317135
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Expert Comment

ID: 9324303

It would really be great if you can tell use what the answer to the problem was. That is if you have found the correct answer since then.


Author Comment

ID: 9373995
Im very very sorry for this delay

i actually forgot this thread, anyway, the code i was using  was wrong, i had to find
some other window inside the other to get the combobox... all the stuff
your code works


Expert Comment

ID: 9401028
Thanks the follow up and accepting the answer, really appreciated :)

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question