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 10:57:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00738764
Message ID:
00738815
Views:
20
>>>or a way to get it from CreateProcess launched one ? TIA
>>>Cetin
>>
>>Hi Cetin,
>>
>>Isn't there a way to test whether an HWND is associated with a given process id?
>>
>>Mike
>
>Yes there is. But unfortunately some apps (DDE broadcasting) like Word has the same pid for all calls to winword. ie:
>
>ShellExecute(0,'open','windword.exe',0,0,1)
>ShellExecute(0,'open','windword.exe',0,0,1)
>ShellExecute(0,'open','windword.exe',0,0,1)
>
>All 3 have same pid and tid :(
>
>Cetin

Cetin,

With Word, you also have the option of using CreateObject/GetObject. Does that help?

In Word 97, as I recall, all new instances share a common physical parent window, i.e. like an MDI application. Which HWND would you want to get in that case?

In Word XP, each opening has its own top-level window, so this might be handled by a generic launch strategy. I'm not clear on what you're trying to do and what the constraints are. Do you have control of the launching of these arbitrary apps? If so, I could elaborate on a somewhat heuristic general approach, which should work with most apps, including Word XP.

Mike
Montage

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

Click here to load this message in the networking platform