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

2009-07-25 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 =

Re: [python-win32] handle is invalid?

2009-07-23 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

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 =