How to get an object's handle inside a window?

Hi experts. I would like to know how to enumerate all the objects within a window. There is a certain program I am using that contains a value (the username) in a text box. So, I need to read that text box, and for that I need the handle. I have the window handle, but I don't know how to get the text box's handle. Is there a way to enumerate all the objects? I am quite sure this is possible since I saw some time ago a program that could say all the values inside text boxes.
Thanks a lot.
ricardodelvalle3Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bkfirebirdConnect With a Mentor Commented:
is this application a external ie you don't have the source code for it ?
You can use EnumChildWindows to get a handle for the text box once you know the parent window's handle.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowFunctions/EnumChildWindows.asp
0
 
mrwad99Commented:
If you are using MFC, you can just say (CEdit Control Name)->GetWindowText(CString)
0
 
mrwad99Commented:
Oh, sorry, it now sounds like you are not writing the program, but are using it.  Hmm.  In that case I don't think it is possible to get handles to controls of windows that you don't own, so to speak.
0
 
mrwad99Commented:
bkfirebird: I stand corrected :)
0
 
ricardodelvalle3Author Commented:
Excelent bkfirebird!! I'll try it tonight when I get home.
Cheers.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.