Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get an object ref from a process id?
Message
From
24/05/2006 16:28:16
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
 
To
24/05/2006 12:41:46
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01124512
Message ID:
01124684
Views:
15
Thanks for the reference. It looks like this might get me what I need if I can figure it out! It's easy to get the AccessibleObject, but I'm not having any luck getting the same object model I'd get from GetObject(). I've used the iDispatch guid and OBJID_NATIVEOM, but no luck yet. I'll keep plugging.

Thanks,

Gary

>Hello,
>
>GETOBJECT() definitly does not work, since each COM class can only be registered once in the system. If you start N instances of MS Word only the first one will be accessible via GETOBJECT() ..
>
>"I can use EnumProcess to get the individual proc ids, but how would one get an object ref from that? Perhaps there is another way?"
>
>just an idea, you might do something like this
>
>API EnumWindows to enumerate all toplevel windows ..
>API GetWindowThreadProcessId to get the process ID of each window
>then check if the process ID of a window is in the list of the process ID's you're interested in.
>API AccessibleObjectFromWindow for each window handle identified like above.
>
>see: http://blogs.msdn.com/calvin_hsia/archive/2005/11/28/497529.aspx
>
>Regards
>Christian
Previous
Reply
Map
View

Click here to load this message in the networking platform