Solved

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

Posted on 2004-04-12
5
291 Views
Last Modified: 2010-04-01
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.
0
Comment
Question by:ricardodelvalle3
[X]
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
5 Comments
 
LVL 19

Expert Comment

by:mrwad99
ID: 10807715
If you are using MFC, you can just say (CEdit Control Name)->GetWindowText(CString)
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 10807742
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
 
LVL 4

Accepted Solution

by:
bkfirebird earned 200 total points
ID: 10807744
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
 
LVL 19

Expert Comment

by:mrwad99
ID: 10807761
bkfirebird: I stand corrected :)
0
 

Author Comment

by:ricardodelvalle3
ID: 10807901
Excelent bkfirebird!! I'll try it tonight when I get home.
Cheers.
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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