>>
>>Yes, I just saw your reply to George. Maybe you would need to use a hybrid approach to cover all of the possible cases, based on certain known characteristics of the application to be launched. If you can modify your asynchronous launching strategy, this might allow you to obtain an HWND after launching an application via ShellExecute by not returning until you've got the HWND. This still would allow the launched job to run concurrently.
>>
>>I don't know if that was clear, or if I understand your problem quite correctly. When you say "I have no problem getting all applications that task manager lists", I think I must be missing something.
>>
>>Mike
>
>I ended up preventing async. call.
>"I have no problem getting all applications that task manager lists"
>I mean I can get handles to all application windows (Task manager lists Document1, Document2 etc for word in 'Applications' but only one winword in 'Processes') distinguishing 'application' windows.
>Basically what I do is (FLL):
>
>Windows2Array(arrCurrent)
>ShellExec app
>*delay - some apps. first invoke a window then it goes away creates another main one
>Windows2Array(arrNew)
>Find new hwnd in arrNew.
>Cetin
Yes, that sounds pretty much like what I had in mind. The tricky part is to sort out the special cases, e.g. when the application has an initial dialog that goes away, or if the user application launches multiple top-level windows. Also there's a timing issue, and the further complication that some instances of ShellExecute simply activate an already existing window.
Mike