[python-win32] Fw: PyIEnumMoniker
Tim Roberts
timr at probo.com
Thu Sep 20 18:36:55 CEST 2007
Radu Ciora wrote:
> ,
> so my question would then be how can I get the running objects which I can see from the combrowser.py?
> 'cos for example I have an object in the combrowse called "D:\Temp\my.pdf" which is an adobe acrobat instance.
> I want to be able to get that document's name&path.
>
In the specific case of Acrobat, you can use the Running Object Table to
do this.
rot = pythoncom.GetRunningObjectTable()
ctx = pythoncom.CreateBindCtx(0)
enu = rot.EnumRunning()
for ob in rot.EnumRunning():
print ob.GetDisplayName( ctx, None ), ob.GetClassID()
You can use the GetClassID GUID to figure out which application it is,
but checking for ".pdf"; in the display name is probably enough.
This does not work in the general case, however. Few applications
register themselves in the ROT. What are you going to do with this
information?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list