I'm using the win32gui library to get a handle to the Windows Security popup and use win32con to click the "Install" button within but without success. Has anyone done this before successfully in Python?
I know I can always install the certificate of the publisher and be done with it for good but I need to account for all security warnings that might pop up.
This can be done because I have done it successfully in VBScript but I need Python now.
.
def window_handle(Title):
handle = win32gui.FindWindowEx(0, 0, 0, Title)
return handle
def click_btn(hWnd, Button):
hbutton = win32gui.FindWindowEx(hWnd, 0, "Button", Button)
if hbutton != 0:
win32api.PostMessage(hbutton, win32con.WM_LBUTTONDOWN, 0, 0)
win32api.PostMessage(hbutton, win32con.WM_LBUTTONUP, 0, 0)
return True
return None
hWnd = window_handle("Windows Security")
click_btn(hWnd, "&Install")