Solved

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

Posted on 2004-04-12
5
286 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

763 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