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-22 Thread reehdus
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 me. Sudheer Tim Roberts wrote: > &g

Re: [python-win32] handle is invalid?

2009-07-22 Thread reehdus
ahha...that would explain a lot...nope...roger's method was excellent...I was trying this out before I saw his recipe. I see...well...pardon my ignorance since I'm pretty new at Python...it didn't really occur to me that FindWindow was redundant. Well, now I know better...hahaha. Thanks! Tim Rob

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.