ahk_class #32770 - popup alert from webpage

Post your working scripts, libraries and tools for AHK v1.1 and older
steppedup
Posts: 3
Joined: 19 May 2017, 11:35

ahk_class #32770 - popup alert from webpage

01 Jun 2017, 22:54

I struggled unbelievably with dealing a confirmation popup from business website - look something like this:
Image

Title: Message from webpage
Windows Text: Do you want to delete this time period?
Buttons: OK and Cancel

Called this script Kill32770.ahk - it lurks in the background killing all #32770 by clicking on ok.

Code: Select all

titleOption:="ahk_exe iexplore.exe ahk_class #32770", GW_OWNER:=4
Loop
{
   WinWait, % titleOption
   WinGet, procName, ProcessName
         , % "ahk_id "DllCall("GetWindow", "Ptr", hWnd:=WinExist(titleOption)
                                         , "UInt", GW_OWNER
                                         , "Ptr")
   If % procName=="IEXPLORE.EXE"
      ControlClick, % "Button1", % "ahk_id "hWnd
   Sleep, 250
Then dumped my main script and the above script into the same folder, and ran them with a batch file -that was killed off from the main script when it ended.

Main script end - this kills all command windows

Code: Select all

SendMessage,0x10,,,,C:\WINDOWS\system32\cmd.exe
		ExitApp ; closes AutoHotKey forcefully.
The batch file - it runs the two above scripts, kills them after 3 minutes to deal with a stubborn separate problem -then relaunches all:

Code: Select all

@echo 
:loop
start "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\Users\me\Desktop\company\Tools\AHK\production\Mass Clearvision Closing Cases\kill32770.ahk"
start "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\Users\me\Desktop\company\Tools\AHK\production\Mass Clearvision Closing Cases\mainscript.ahk"
timeout /t 180 >null
taskkill /f /im autohotkey.exe >nul
taskkill /f /t /im iexplore.exe >nul
goto loop

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: gwarble and 84 guests