For IE in ComObjCreate("Shell.Application").Windows ; for each open window
If InStr(IE.FullName, "iexplore.exe") ; check if it's an ie window
break ; keep that window's handle
; this assumes an ie window is available. it won't work if not
This is the first I seen IE used in place of PWB or WB.
Is there any kind of unofficial standard when to use what?
Maybe...
PWB (Autohotkey Basic)
WB (Autohotkey_L)
IE (? Would it be better to leave it as WB)
Changing to IE threw me off. I used IE to use an existing IE window instead of creating a new one, but forgot to change WB to IE throughout the rest of my script
I use this code to easily change between creating a new IE window or using an existing one.
CreateNewIeObject := 0
if CreateNewIeObject = 1 ;create new IE windows
WB := ComObjCreate("InternetExplorer.Application")
else ;use Existing IE window
{
For WB in ComObjCreate("Shell.Application").Windows ; for each open window
If InStr(WB.FullName, "iexplore.exe") ; check if it's an ie window
break ; keep that window's handle
}