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

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Coldblackice
Posts: 19
Joined: 13 Nov 2013, 14:39

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

22 Jan 2015, 13:45

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?
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

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

22 Jan 2015, 14:04

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

Return to “Ask For Help”

Who is online

Users browsing this forum: Evil-e, flyingDman, takayo97, theelf, wineguy and 269 guests