def close_window(hwnd): """ Sends a message to close the given window. Args: hwnd (int): The window handler. """ wg.PostMessage(hwnd, wc.WM_CLOSE, 0, 0)