Hi All,
I'm trying to close a browser window either by sending Alt+f4 or Alt+f to open the file menu and then 'x' to exit and am trying to achieve this using win32api.SendMessage(). I tried all combinations of WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, VK_MENU and VK_F4 but couldn't get this.
I'm stuck on this one since two days and I really appreciate any help.
I can't use sendkeys since this window is not always in focus. I can't also use
SendMessage(hwnd, win32con.WM_SYSCOMMAND, win32con.VK_CLOSE, 1) since there are some additional dialogs need to be handles upon close.
(like the confirmation dialog for closing tabs)
On a similar note can someone explain whats the last parameter used in SendMessage. I'm able to send 'tab' to a dialog using SendMessage(hwnd, win32con.WM_CHAR, win32con.VK_TAB, 1) but its not successful all the time if I replace 1 with 0 (the last param)
Thanks in Advance!