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 =
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
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 =