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

Mike,
In word97 or XP I can get separate instances (window with title like "document1","document2"). IOW I have no problem getting all applications that task manager lists. See my last reply to George for what I'm trying to accomplish. Called thing might be winword.exe, mydos.com or somebat.bat :(
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform