AutoHotkey Community

It is currently May 26th, 2012, 9:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: July 29th, 2009, 9:16 am 
Offline

Joined: September 23rd, 2006, 1:58 pm
Posts: 149
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 January 28th, 2012, 3:13 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 9:37 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Cool 8)
Many thanks for sharing :D

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 10:12 am 
Offline

Joined: September 23rd, 2006, 1:58 pm
Posts: 149
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 January 28th, 2012, 3:13 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 10:15 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Cute.. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 10:39 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 10:56 am 
mmhm,
i have no dual-monitor setup, so i have to think about it a bit.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 11:08 am 
Offline

Joined: September 23rd, 2006, 1:58 pm
Posts: 149
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 January 28th, 2012, 3:14 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 11:20 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 11:51 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 12:06 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Unfortunately not, see what happens:
Before:
Image

After:
Image

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 29th, 2009, 12:26 pm 
that looks weird.
i found a typo, if that not solves it, i´m out of options :oops:
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


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group