PavelGur
Programmer
- Sep 21, 2001
- 75
I need to post messages from one console program to another that I’ve started with CreateProcess.. I need to find the handle to the window of new program to do it. I tried
HWND myhwnd;
while ( NULL == myhwnd)
{
myhwnd = ::FindWindowEx ( NULL, NULL, NULL, szMyPath );
}
However it always returns NULL. I also tried to find handle of the window for parent process with the same result.
I can see both windows in Spy++ with titles equal to program paths. The handles are there as well. But how I can get them programmatically?
Thanks, Pavel.
HWND myhwnd;
while ( NULL == myhwnd)
{
myhwnd = ::FindWindowEx ( NULL, NULL, NULL, szMyPath );
}
However it always returns NULL. I also tried to find handle of the window for parent process with the same result.
I can see both windows in Spy++ with titles equal to program paths. The handles are there as well. But how I can get them programmatically?
Thanks, Pavel.