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.PROCESS_QUERY_INFORMATION|win32con.PROCESS_VM_READ,0,p)#use PID to get process handle path = win32process.GetModuleFileNameEx(handle, 0)#use process handle to get path of window path = '\\'.join(path.split('\\')[0:-1])#delete all terms after final '\' including '\' path = path + '\\'#append '\' to path Seems to be working fine so far. Thanks a lot guys! Really appreciate the help -- View this message in context: http://www.nabble.com/Trying-to-grab-exe-of-foreground-window-tp24582049p24636956.html Sent from the Python - python-win32 mailing list archive at Nabble.com. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32