Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving window handlers of child processes

Status
Not open for further replies.

darioars

Technical User
Oct 30, 2002
21
0
0
DE
Hi guys!

I have programmed a C++ application containing calls to the function CreateProcess. These processes display windows on the screen but their sizes and positions are not the ones I prefer, so I decided to set them. In order to achieve it, I need HWND handlers, do any of you how to retrieve them?

Thanks a lot in advance!
Darío.
 
I did this a long time ago (5 years or more) and in C rather than C++.

My dim memory of this suggests that you need to search all the child windows of the Desltop window looking for the titles of your created windows and from that you can get the HWND and Post (never Send) the appropriate messages to them.

Hope this helps.

________________________________________
[hippy]Roger J Coult; Grimsby, UK
In the game of life the dice have an odd number of sides.
 
Yes, to do that you could call EnumWindows(), passing the address of an EnumWindowsProc() callback function. The callback is called for every top-level window, giving you the HWND of each. To retrieve the title call GetWindowText() using the HWND.

A better way, if you are writing those other programs too, would be to allow the desired window position and size to be passed to the program through the command line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top