Cheers.
Code: Select all
DetectHiddenWindows, on
z::MsgBox % IE_IsDownloadNotificationActive()
x::IE_DownloadNotificationCancel()
a::IE_DownloadNotificationSaveAs()
s::IE_DownloadNotificationSave()
d::IE_DownloadNotificationOpen()
IE_DownloadNotificationSave(){
If !SubStr(IE_IsDownloadNotificationActive(),1,1) ;the first substr as the function returns more than one line...6
Return
;to test whether it's visible and retrieve its name (it should be 'Notification')
WinGet, hWnd, ID, A
ControlGet, hCtl, Hwnd,, DirectUIHWND1, % "ahk_id " hWnd
ControlGet, vIsVisible, Visible,, DirectUIHWND1, % "ahk_id " hWnd
oAcc := Acc_ObjectFromWindow(hCtl)
oAccNotif := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
;to close the notification bar
oAcc := Acc_Get("Object", "4.3", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
Return
}
IE_DownloadNotificationSaveAs(){
If !SubStr(IE_IsDownloadNotificationActive(),1,1) ;the first substr as the function returns more than one line...
Return
;internet explorer - notification bar interactions (click 'Save as')
;to test whether it's visible and retrieve its name (it should be 'Notification')
WinGet, hWnd, ID, A
ControlGet, hCtl, Hwnd,, DirectUIHWND1, % "ahk_id " hWnd
ControlGet, vIsVisible, Visible,, DirectUIHWND1, % "ahk_id " hWnd
oAcc := Acc_ObjectFromWindow(hCtl)
oAccNotif := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
;to click the down arrow
oAcc := Acc_Get("Object", "4.3.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
WinWait, ahk_class #32768
PostMessage, 0x102, % Ord("a"), 1,, % ahk_class #32768 ;WM_CHAR ;worked
}
IE_DownloadNotificationOpen(){
If !SubStr(IE_IsDownloadNotificationActive(),1,1) ;the first substr as the function returns more than one line...
Return
;to test whether it's visible and retrieve its name (it should be 'Notification')
WinGet, hWnd, ID, A
ControlGet, hCtl, Hwnd,, DirectUIHWND1, % "ahk_id " hWnd
ControlGet, vIsVisible, Visible,, DirectUIHWND1, % "ahk_id " hWnd
oAcc := Acc_ObjectFromWindow(hCtl)
oAccNotif := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
;to close the notification bar
oAcc := Acc_Get("Object", "4.2", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
Return
}
IE_DownloadNotificationCancel(){
If !SubStr(IE_IsDownloadNotificationActive(),1,1) ;the first substr as the function returns more than one line...
Return
;to test whether it's visible and retrieve its name (it should be 'Notification')
WinGet, hWnd, ID, A
ControlGet, hCtl, Hwnd,, DirectUIHWND1, % "ahk_id " hWnd
ControlGet, vIsVisible, Visible,, DirectUIHWND1, % "ahk_id " hWnd
oAcc := Acc_ObjectFromWindow(hCtl)
oAccNotif := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
oAcc := Acc_Get("Object", "4.5", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
Return
}
IE_IsDownloadNotificationActive(){
ControlGet, vIsVisible, Visible, , DirectUIHWND1, A
ControlGet, hCtl, Hwnd, , DirectUIHWND1, A
oAcc := Acc_ObjectFromWindow(hCtl)
oAccNotif := Acc_Get("Object", "4.1", 0, "ahk_id " hCtl)
Try
Return % vIsVisible "`n" oAcc.accName(0) "`n" oAccNotif.accName(0) "`n" oAccNotif.accValue(0)
}