How does AHK monitor the IE save dialog box and wait for the dialog box to appear?

as shown in the following figure, I need to wait for the AHK to monitor the save dialog box in IE before doing anything else.

Mar.05,2021

generally speaking, the first thing to do is to use OnMessage to listen for messages. You may use DLLCALL, to call the system API, but I'm not sure which one to use. I've seen other people use it like this before. Post the code here. This code can monitor a lot of interface changes, which may enlighten your question. The comments in it are not quite right, because I have changed it several times, but the core part is fine.

; -sharp ShellMessage()
Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
;"MsgNum","ShellMessage"
OnMessage( MsgNum, "ShellMessage")

; -sharp 
cn_win := ["Win_10_VM - VMware Workstation"]
loop % cn_win.MaxIndex()
GroupAdd,cn,% cn_win[A_Index]

ShellMessage( wParam,lParam ) {

    ;1 
    ;2 
    ;3 SHELL 
    ;4 
    ;5 
    ;6 Windows 
    ;7 
    ;8 
    ;9 
    ;10 
    ;11
    ;12 APPCOMMANDWM_APPCOMMAND
    ;13 wParam=hWnd
    ;14 wParam=hWnd
    ;&H8000& 
    ;53 
    ;54 
    ;32772 
    
    ;
    if ( wParam = 1 )
    {
        Sleep, 1000
            return
    }
    ;
    if ( wParam = 32772 ){
        if WinActive("Win_10_VM"){
        MsgBox,3
        }

return
    }
}


MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a281-2c1d7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a281-2c1d7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?