AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Spot_On_Mouse & Single-Window

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Zed Gecko



Joined: 23 Sep 2006
Posts: 149

PostPosted: Wed Jul 29, 2009 8:16 am    Post subject: Spot_On_Mouse & Single-Window Reply with quote

i´d like to share this very simple script:
Spot_On_Mouse
creates a spotlight-like effect around the mouse-cursor.
"CTRL + ALT + S" toggles the spotlight-mode on/off
"+" and "-" resize the spot
"CTRL + ALT + M" starts the "find-the-mouse-cursor" aid-tool
Code:
code removed due to protest.
http://www.autohotkey.com/forum/viewtopic.php?t=81795

another (more useful) use for this method might be Single-Window found below.


Last edited by Zed Gecko on Sat Jan 28, 2012 2:13 am; edited 2 times in total
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Wed Jul 29, 2009 8:37 am    Post subject: Reply with quote

Cool Cool
Many thanks for sharing Very Happy
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Zed Gecko



Joined: 23 Sep 2006
Posts: 149

PostPosted: Wed Jul 29, 2009 9:12 am    Post subject: Reply with quote

thanks.
the same method targeted at the active window results to this:
Single Window , blacks-up everything but the active window.
"CTRL + ALT + S" toggles the "Single Window"-mode on/off
Code:
code removed due to protest.
http://www.autohotkey.com/forum/viewtopic.php?t=81795

_________________
code removed due to protest.
http://www.autohotkey.com/forum/viewtopic.php?t=81795


Last edited by Zed Gecko on Sat Jan 28, 2012 2:13 am; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Jul 29, 2009 9:15 am    Post subject: Reply with quote

Cute.. Very Happy
Back to top
View user's profile Send private message Send e-mail
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Wed Jul 29, 2009 9:39 am    Post subject: Reply with quote

Can you make that AltTab window will be always visible, it gets hidden sometimes for me (possible because i am using 2 Monitors)?
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Wed Jul 29, 2009 9:56 am    Post subject: Reply with quote

mmhm,
i have no dual-monitor setup, so i have to think about it a bit.
Back to top
Zed Gecko



Joined: 23 Sep 2006
Posts: 149

PostPosted: Wed Jul 29, 2009 10:08 am    Post subject: Reply with quote

does this work better?
Code:
code removed due to protest.
http://www.autohotkey.com/forum/viewtopic.php?t=81795

_________________
code removed due to protest.
http://www.autohotkey.com/forum/viewtopic.php?t=81795


Last edited by Zed Gecko on Sat Jan 28, 2012 2:14 am; edited 1 time in total
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Wed Jul 29, 2009 10:20 am    Post subject: Reply with quote

No, unfortunately not. Half of screen is black and on second monitor as well but a part of the black screen is also visible.

Looks like it got a problem when active window is on the second screen as this one is not set black.

I think you would need to address both screens separately (for each its own black window).
_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Wed Jul 29, 2009 10:51 am    Post subject: Reply with quote

how about that?
Code:
spotstate := 1
Gui -Caption +AlwaysOnTop +LastFound +ToolWindow
Gui, Color, 0x000000, 0x000000
WinGet, IDvar , ID
SysGet, V_ScreenX, 76
SysGet, V_ScreenY, 77
SysGet, V_ScreenWidth, 78
SysGet, V_ScreenHeight, 79
PolygonP1 := V_ScreenX . "-" . V_ScreenY . " "
gosub, MakePolygonP2
PolygonP3 := V_ScreenX . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenY
MakeSingle:
activestart := WinActive("A")
Gui, Show, x%V_ScreenY% y%V_ScreenY% h%V_ScreenHeight% w%V_ScreenWidth%
WinActivate, ahk_id %activestart%
loop
{
   gosub, MakePolygonP2
   Polygon := PolygonP1 . PolygonP2 . PolygonP3
   WinSet, Region, %Polygon%, ahk_id %IDvar%
   IfWinNotExist ahk_class #32771
      Gui +AlwaysOnTop
   sleep, 10
   if (spotstate != 1)
      break
}
return


~^!s::
spotstate := !spotstate
if (spotstate = 0)
   Gui, Hide
else
   SetTimer, MakeSingle, -1    
return

Esc::ExitApp

MakePolygonP2:
WinGetActiveStats, Title, Width, Height, X, Y
PolygonP2 := X . "-" . Y . " " . X . "-" . Y + Height . " " . X + Width . "-" . Y + Height . " " . X + Width . "-" . Y . " " . X . "-" . Y . " "
return
Back to top
HotKeyIt



Joined: 18 Jun 2008
Posts: 4652
Location: AHK Forum

PostPosted: Wed Jul 29, 2009 11:06 am    Post subject: Reply with quote

Unfortunately not, see what happens:
Before:


After:

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun Wink
Back to top
View user's profile Send private message
Z_Gecko
Guest





PostPosted: Wed Jul 29, 2009 11:26 am    Post subject: Reply with quote

that looks weird.
i found a typo, if that not solves it, i´m out of options Embarassed
Code:
spotstate := 1
Gui -Caption +AlwaysOnTop +LastFound +ToolWindow
Gui, Color, 0x000000, 0x000000
WinGet, IDvar , ID
SysGet, V_ScreenX, 76
SysGet, V_ScreenY, 77
SysGet, V_ScreenWidth, 78
SysGet, V_ScreenHeight, 79
PolygonP1 := V_ScreenX . "-" . V_ScreenY . " "
gosub, MakePolygonP2
PolygonP3 := V_ScreenX . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenY
MakeSingle:
activestart := WinActive("A")
Gui, Show, x%V_ScreenX% y%V_ScreenY% h%V_ScreenHeight% w%V_ScreenWidth%
WinActivate, ahk_id %activestart%
loop
{
   gosub, MakePolygonP2
   Polygon := PolygonP1 . PolygonP2 . PolygonP3
   WinSet, Region, %Polygon%, ahk_id %IDvar%
   IfWinNotExist ahk_class #32771
      Gui +AlwaysOnTop
   sleep, 10
   if (spotstate != 1)
      break
}
return


~^!s::
spotstate := !spotstate
if (spotstate = 0)
   Gui, Hide
else
   SetTimer, MakeSingle, -1    
return

Esc::ExitApp

MakePolygonP2:
WinGetActiveStats, Title, Width, Height, X, Y
PolygonP2 := X . "-" . Y . " " . X . "-" . Y + Height . " " . X + Width . "-" . Y + Height . " " . X + Width . "-" . Y . " " . X . "-" . Y . " "
return
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group