Page 1 of 1

Possible to limit to when user is typing in URL address bar?

Posted: 22 Jan 2015, 13:45
by Coldblackice
Would it be possible to limit a script from acting except only when the user is typing in the URL address bar of Internet Explorer? I have some things that I want to be done, but only when the user is typing in the address bar.

If possible, how would I go about it?

Re: Possible to limit to when user is typing in URL address

Posted: 22 Jan 2015, 14:04
by MJs

Code: Select all

actingexceptonlywhentheuseristypingintheURLaddressbarofInternetExplorer(){
hWnd := WinActive("ahk_class IEFrame") ; return the IE window handle if the active window IS IE
if !hWnd ; the IE is not active
	return
ControlGetFocus, Focused, A ; return the focused control in the active window
return, (Focused="Edit1") ; return true if the focused control is the URL address
}

; for example a hotkey A
; Rempad A to B
; but just for The URL Adress bar in the internet explorer
#if actingexceptonlywhentheuseristypingintheURLaddressbarofInternetExplorer() ; see #If in the docs, you'd have better understanding later
A::
Send B
return