DonationCoder.com Software > Post New Requests Here
Forward button on Mouse Explorer to Open Link in a New Window
wasker:
I've got an MS MouseExplorer and came with the following code to make it open links in a new window when I browsing with IE:
XButton2::
If WinActive("ahk_class IEFrame")
{
Send, {SHIFT down}{LButton}{SHIFT up}
return
}
else
{
Send, {XButton2}
return
}
Now I would like to make it work with all apps that use IE for browsing purposes (Html Help for instance). I need to detect the class of window that is currently under mouse cursor. How to do this?
mouser:
great question.
there are programs that will tell you the windows classes of other windows; often they have "spy" in their names, like windows "spy" or something. i can't remember any off hand but if you can't find a good free one with google and no one else posts the link for one i'll look again.
wasker:
Actually I know window class name I need. And in fact AutoHotkey has the Spy in its distro for this purpose. What I don't know is which function of AutoHotkey determines the class of window under cursor. I mean not the window like IE window itself, but rather control's window (InternetExplorer_Server for instance).
In other word: I want Autohotkey to run the aforementioned macro if the mouse is over WebBrowser control (InternetExplorer_Server class) in any application (IE, HtmlHelp, Visual Studio, etc.). Is this possible? If yes, then which function I should use?
mouser:
ahh... i understand now what you are saying..
but it's beyond my knowledge - skrommel or someone else will know hopefully - definitely should be possible.
skrommel:
:) Here's a script from AHK's help file:
--- ---; This example allows you to move the mouse around to see
; the title of the window currently under the cursor:
#Persistent
SetTimer, WatchCursor, 100
return
WatchCursor:
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
ToolTip, ahk_id %id%`nahk_class %class%`n%title%`nControl: %control%
return
Skrommel
Navigation
[0] Message Index
[#] Next page
Go to full version