Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to get HWND of ShellExecute launched app
Message
 
To
07/01/2003 12:11:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00738764
Message ID:
00738894
Views:
23
>>
>>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
Montage

"Free at last..."
Previous
Reply
Map
View

Click here to load this message in the networking platform