Re: [python-win32] trying to grab exe of foreground window

2009-07-24 Thread reehdus
Awesome, thanks Eric, Roger and Tim for your help. Everything's been working fine so far. Here's what I've been using. It works on Vista too but I have admin access to that though. t,p = win32process.GetWindowThreadProcessId(hwnd)#find out PID to window handle = win32api.OpenProcess(win32con.PRO

Re: [python-win32] trying to grab exe of foreground window

2009-07-24 Thread Michel Claveau
Hi, Eric! Below, derived from your code, an exemple for to found modules in memory (useful for "scan memory" with clamwin, or other usages) @-salutations -- Michel Claveau import win32api,win32con,win32process,win32security # Request privileges to enable "debug process", so we can later us

Re: [python-win32] trying to grab exe of foreground window

2009-07-23 Thread Eric Blade
> -- >> Tim Roberts, t...@probo.com >> Providenza & Boekelheide, Inc. >> >> ___ >> python-win32 mailing list >> python-win32@python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> > &

Re: [python-win32] Trying to grab exe of foreground window

2009-07-23 Thread Tim Roberts
reehdus wrote: > > I see...I tried looking for documentation onw win32con to see what I > needed but I couldn't muster up anything. All i got were > win32con.PROCESS_TERMINATE and process query information so I assumed one of > this was what I needed. Again...thanks so much for enlightening

Re: [python-win32] Trying to grab exe of foreground window

2009-07-22 Thread reehdus
Excellent...it works! Thanks...I put in the first sleep so I could test the program with various other applications, so it'd give me enough time to open up internet explorer or something...the second sleep was a typo...leftover from a bit of earlier code i did. I see...I tried looking

Re: [python-win32] Trying to grab exe of foreground window

2009-07-22 Thread Tim Roberts
reehdus wrote: > I tried that but I get stuck at EnumProcessModules. It tells me my access is > denied. I'm not sure if I'm doing it right. My code is below: > > import win32gui > import win32api > import win32con > from time import sleep > import win32process > > sleep(2) > name = win32gui.GetFore

[python-win32] Trying to grab exe of foreground window

2009-07-22 Thread Roger Upole
reehdus wrote: I tried that but I get stuck at EnumProcessModules. It tells me my access is denied. I'm not sure if I'm doing it right. My code is below: import win32gui import win32api import win32con from time import sleep import win32process sleep(2) name = win32gui.GetForegroundWindow() t,

Re: [python-win32] Trying to grab exe of foreground window

2009-07-21 Thread reehdus
I tried that but I get stuck at EnumProcessModules. It tells me my access is denied. I'm not sure if I'm doing it right. My code is below: import win32gui import win32api import win32con from time import sleep import win32process sleep(2) name = win32gui.GetForegroundWindow() t,p = win32process.

[python-win32] Trying to grab exe of foreground window

2009-07-20 Thread Roger Upole
A sequence like this should get you there. win32gui.GetForegroundWindow win32process.GetWindowThreadProcessId win32api.OpenProcess win32process.EnumProcessModules win32process.GetModuleFileNameEx hth Roger ___ python-win32 mailing list pyth

[python-win32] Trying to grab exe of foreground window

2009-07-20 Thread sudheer sivathasan
Hi guys, Normally I’m able to find the answers I’m looking for on the net…but this time, either I haven’t searched hard enough or no one has attempted this before, so I would really like to request some help with this. I’m trying to write a program to locate the directory of the .exe of the