A sequence like this should get you there. win32gui.GetForegroundWindow win32process.GetWindowThreadProcessId win32api.OpenProcess win32process.EnumProcessModules win32process.GetModuleFileNameEx hth Roger