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 12:41:46
 
 
To
24/05/2006 09:38:06
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
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:
01124572
Views:
9
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
Next
Reply
Map
View

Click here to load this message in the networking platform