I have no idea. Some libffi magic is involved there. But this code snipplet shows how to make use of it.from ctypes import windll user32= windll.user32 hwnd= user32.GetForegroundWindow()This will return the handle of the current foreground window, directly accessing the GetForegroundWindow api exposed by user32.dll
Get the windows platform SDK read into the documentation, read into ctypes and call any api present on your system and watch them doing all the hard work work for you ;-)
Post to the wnd-users mailing list on the project page at sourceforge