How to get the hWnd of the main window of a process that is started using CreateProcess?
Posted on 2003-10-06 21:38:04 by optimus
Well, I geuss since you have a thread id you can use EnumThreadWindows. It will enumerate all non-child windows. Haven't tried this:
invoke CreateProcess, blah, blah, blah

invoke EnumThreadWindows,pi.dwThreadId ,OFFSET enumfunc,NULL

enumfunc proc hwnd:DWORD,lParam:DWORD
; I think the first handle passed is the main window
mov eax,FALSE
enumfunc endp

EDIT used the wrong feild of the pi structure - corrected
Posted on 2003-10-06 21:58:12 by donkey