|
-
August 12th, 2005, 12:00 AM
#3
Re: ShellExecuteEx process to HWND handle
 Originally Posted by golanshahar
you can try doing something like this:
Code:
HWND h = ::GetTopWindow(0 );
while ( h )
{
DWORD pid;
DWORD dwTheardId = ::GetWindowThreadProcessId( h,&pid);
HANDLE hProc = ::OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid);
if ( hProc == /*your process handle*/ )
{
// here h is the handle to the window
break;
}
h = ::GetNextWindow( h , GW_HWNDNEXT);
}
hope it will help
Cheers
DWORD pid;
DWORD dwTheardId = ::GetWindowThreadProcessId( h,&pid);
HANDLE hProc = ::OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid);
????
no no no.
Code:
if (pid == /*your process id*/)
Best Api Monitor tool.
Trace the target program automatically and monitor the parameters of all API and COM interfaces.
Auto Debug for Windows 4.0
Auto Debug for .Net
http://www.autodebug.com/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|