Re: WaitForSingleObject...
I know nothing about those APIs. But I think there are cases when a particular program can be presented by several windows in a memory, like Symantec WinFax. In a such case I used to look for all of them by using:
[lngHandle0 = FindWindow("MOD", vbNullString)
lngHandle1 = FindWindow("WFXMOD", vbNullString)
lngHandle2 = FindWindow("WFXIFMODMODTHREADWINDOW", vbNullString)
lngHandle3 = FindWindow("WFXIFEXEMainWindow", vbNullString)
lngHandle4 = FindWindow("#32770", vbNullString)
lngHandle1 = FindWindow("Sfaxmng", vbNullString)
lngHandle2 = FindWindow("Cfaxmng", vbNullString)
lngHandle7 = FindWindow("AVIWnd", vbNullString)]
First parameter is Class of window and you can find it with Spy++ when that particular program is running. Maybe it will help.
Vlad
Re: WaitForSingleObject...
My main problem is in determining if the program is responding to Windows messages or not. Will the program retain all the child windows in memory if is is not?
Re: WaitForSingleObject...
In my experience if you use WaitForSingleObject your program will not respond to Windows messages during the wait period.
This is why I usually wait in small intervals like one tenth of a second and use a timer to repeatedly call WaitForSingleObject.
you could probably also use DoEvents as in
lResult = WaitForSingleObject(...)
do while not ...
DoEvents
lResult = WaitForSingleObject(...)
Loop
Re: WaitForSingleObject...
Yes, I realise this and planned to do that. But I was wondering if the return value from WaitForSingleObject would indicate if the window was frozen (not receiving Windows messages) or, if it was, indicate it was still running. As an alternative, would MsgWaitForMultpipleObjects work since it monitors certain types of messages in the que for certain objects (I think...). At any rate, thank you for your help.