Welcome Guest.   Make a donation to an author on the site November 22, 2014, 11:54:17 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Forward button on Mouse Explorer to Open Link in a New Window  (Read 7074 times)
wasker
Charter Honorary Member
***
Posts: 52


View Profile Give some DonationCredits to this forum member
« on: December 14, 2005, 06:45:50 AM »

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?
Logged
mouser
First Author
Administrator
*****
Posts: 33,690



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: December 14, 2005, 08:44:46 AM »

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.
Logged
wasker
Charter Honorary Member
***
Posts: 52


View Profile Give some DonationCredits to this forum member
« Reply #2 on: December 14, 2005, 08:56:22 AM »

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?
Logged
mouser
First Author
Administrator
*****
Posts: 33,690



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: December 14, 2005, 09:03:02 AM »

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.
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: December 14, 2005, 11:49:37 AM »

 smiley Here's a script from AHK's help file:

[copy or print]
; 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
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
wasker
Charter Honorary Member
***
Posts: 52


View Profile Give some DonationCredits to this forum member
« Reply #5 on: December 14, 2005, 12:42:07 PM »

Ah, I see. Thanks!  Thmbsup

Here's what I've got. It works as expected so far.

[copy or print]
XButton2::
SetTimer, LookForInternetExplorer, 50
return

LookForInternetExplorer:
SetTimer, LookForInternetExplorer, Off
MouseGetPos,,, id, control
IfInString, control, Internet Explorer_Server
{
    Send, {SHIFT down}{LButton}{SHIFT up}
    return
}
else
{
    Send, {XButton2}
    return
}
return
Logged
skywalka
Member
**
Posts: 253


View Profile Give some DonationCredits to this forum member
« Reply #6 on: December 15, 2005, 01:18:25 AM »

I use the Maxthon browser (the best browser ever) which has an option 2 open links in a new tab via the middle mouse button.

Is it possible 2 open links with the middle mouse button from outside Maxthon itself.  ie Outlook Express & the Favorites bar etc?
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: December 15, 2005, 01:49:38 AM »

 undecided You could send a RightClick and choose Copy Shortcut or something from the menu, depending on the window beneath the cursor, and then Run or paste it.

Skrommel
« Last Edit: December 15, 2005, 01:51:11 AM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
skywalka
Member
**
Posts: 253


View Profile Give some DonationCredits to this forum member
« Reply #8 on: December 15, 2005, 01:55:29 AM »

OK.  Thanx.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.045s | Server load: 0.02 ]