def getWindowPID ( self , hwnd ) : pid = ctypes . c_ulong ( ) ctypes . windll . user32 . GetWindowThreadProcessId ( hwnd , ctypes . byref ( pid ) ) return int ( pid . value )
get window name from pid python
Gets the process ID that the specified window belongs to
def getWindowPID(self, hwnd):
        """ Gets the process ID that the specified window belongs to """
        pid = ctypes.c_ulong()
        ctypes.windll.user32.GetWindowThreadProcessId(hwnd, ctypes.byref(pid))
        return int(pid.value)