[ctypes-users] destroying a window on windows
Brought to you by:
theller
From: Michael C <mys...@gm...> - 2017-05-17 23:10:35
|
Apparently even though the MSDN says, given a handle, it would kill the window, but it doesn't do that for me. Am I doing it properly? Thanks! import time import ctypes User32 = ctypes.WinDLL('User32', use_last_error=True) handle = User32.GetForegroundWindow() print(handle) time.sleep(2) User32.DestroyWindow(handle) |