[python-win32] Any way to get PyHANDLE for any running process?

Jens B. Jorgensen jens.jorgensen at tallan.com
Fri Jul 2 11:05:03 EDT 2004


Hmmm, EnumProcesses would be oneWin32 call to get at this but for 
whatever reason I don't see that call present in win32process. Odd. I 
think you may be able to enumerate them through WMI and then use 
win32api.OpenProcess to get the handle to it. I'd look down that avenue.

Brett Cannon wrote:

> I am having a problem of a process not closing when it should, 
> actually stemming from IE's COM object, and it prevents me from 
> creating another IE COM object.  I would like to have some way to 
> check if IEXPLORE.EXE is already running, and if so, then kill it.
>
> I noticed win32process.TerminateProcess(), but it wants a PyHANDLE and 
> I can't figure out how to create one for any process other than the 
> currently running one.
>
> Any help on this would be great.  Already sick of doing it manually 
> through the Task Manager.
>
> -Brett
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



-- 
Jens B. Jorgensen
jens.jorgensen at tallan.com

"With a focused commitment to our clients and our people, we deliver value through customized technology solutions"  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3108 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.python.org/pipermail/python-win32/attachments/20040702/55a8f923/smime.bin


More information about the Python-win32 mailing list