>>>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