 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
David.P
Joined: 18 Nov 2006 Posts: 237
|
Posted: Fri Nov 20, 2009 10:09 am Post subject: Flash a red circle where the cursor is |
|
|
Hi forum,
is it possible to briefly show a red (circular) dot at the cursor position (in order to signal a certain state change of a script)?
Kind of like this:
Thanks
David.P |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
|
| Back to top |
|
 |
David.P
Joined: 18 Nov 2006 Posts: 237
|
Posted: Fri Nov 20, 2009 11:24 am Post subject: |
|
|
Uaahh thanks that's amazing....!
Me hovewer was more like looking for a "two lines of code" solution for a simple circle...
Is that possible -- maybe with a simple GUI command and then WinSet Region, or something...........?
Thanks David.P |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Fri Nov 20, 2009 11:26 am Post subject: |
|
|
A circle will not be possible I think, since there is no circle control, a square should be no problem, using WinSet,TransColor... _________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
|
| Back to top |
|
 |
David.P
Joined: 18 Nov 2006 Posts: 237
|
Posted: Fri Nov 20, 2009 12:11 pm Post subject: |
|
|
Thanks -- that's hovewer another 250 lines and I don't even find the relevant ones that actually draw the thing
Unfortunately I can't find any other examples on the forum either...
Well I think I'll have to come up with some code myself  |
|
| Back to top |
|
 |
doyle
Joined: 14 Nov 2007 Posts: 279 Location: London, England
|
Posted: Fri Nov 20, 2009 12:15 pm Post subject: |
|
|
God forbid!
And good luck with doing this in 2 lines. |
|
| Back to top |
|
 |
hugov
Joined: 27 May 2007 Posts: 2181
|
Posted: Fri Nov 20, 2009 12:24 pm Post subject: |
|
|
| David.P wrote: | | Thanks -- that's hovewer another 250 lines and I don't even find the relevant ones that actually draw the thing | 200 of those lines are INI, an about box, and configuration menu. So 50 is all you need and you probably won't find much room to cut down the number of lines. _________________ Tut 4 Newbies
TF : Text file & string lib, TF Forum |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Fri Nov 20, 2009 12:36 pm Post subject: |
|
|
Try this, it will be shown when you hold CTRL: | Code: | Gui,+LastFound
Gui,Color,FF0000
hwnd:=WinExist()
Gui,Show,NA w100 h100
WinSet,Region,30-30 W40 H40 E,ahk_id %hwnd%
WinSet,Transparent,150,ahk_id %hwnd%
Gui,Hide
Return
~Ctrl::
MouseGetPos,x,y
Gui,Show,% "x " x-50 "y" y-50
KeyWait, CTRL
Gui,Hide
Return
Esc::
GuiClose:
ExitApp |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
doyle
Joined: 14 Nov 2007 Posts: 279 Location: London, England
|
Posted: Fri Nov 20, 2009 3:30 pm Post subject: |
|
|
Mine doesnt move with the mouse.
Is it meant to? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 7698 Location: Germany (but I only speak English)
|
Posted: Fri Nov 20, 2009 3:33 pm Post subject: |
|
|
you hadn't asked for that. It is only going to show where the mouse was when Ctrl was pressed.
| Code: |
Gui,+LastFound
Gui,Color,FF0000
hwnd:=WinExist()
Gui,Show,NA w100 h100
WinSet,Region,30-30 W40 H40 E,ahk_id %hwnd%
WinSet,Transparent,150,ahk_id %hwnd%
Gui,Hide
Return
~Ctrl::
MouseGetPos,x,y
SetTimer, showit, 50
KeyWait, CTRL
SetTimer, showit, Off
Gui,Hide
Return
showit:
Gui,Show,% "x " x-50 "y" y-50
Return
Esc::
GuiClose:
ExitApp |
_________________
Unless noted, all code is UNTESTED.
Answers Here: 1.(Loops, Viruses, etc.) 2.Search 3.RTFM 4.Ask for Help.
PMs will be ignored unless you are hiring me. |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 1770 Location: MN, USA
|
Posted: Fri Nov 20, 2009 3:42 pm Post subject: |
|
|
I tweaked it a bit. | Code: | CoordMode, Mouse
Gui, +LastFound +AlwaysOnTop +Toolwindow -Caption
Gui, Color, Red
Gui, Show, Hide w100 h100
WinSet, Region, 30-30 W40 H40 E
WinSet, Transparent, 150
return
~Ctrl::
MouseGetPos,x,y
Gui,Show,% "NA x " x-50 "y" y-50
KeyWait, Ctrl
Gui,Hide
Return
Esc::
GuiClose:
ExitApp |
_________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
HotKeyIt
Joined: 18 Jun 2008 Posts: 1994 Location: GERMANY
|
Posted: Fri Nov 20, 2009 4:29 pm Post subject: |
|
|
I did too  | Code: | CoordMode, Mouse
Gui, +LastFound +AlwaysOnTop +Toolwindow -Caption
Gui, Color, Red
Gui, Show, Hide w100 h100
WinSet, Region, 30-30 W40 H40 E
WinSet, Transparent, 150
return
~Ctrl::
MouseGetPos,x,y
Gui,Show,% "NA x " x-50 "y" y-50
Return
~Ctrl Up::Gui,Hide
Esc::
GuiClose:
ExitApp |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
David.P
Joined: 18 Nov 2006 Posts: 237
|
Posted: Fri Nov 20, 2009 4:50 pm Post subject: |
|
|
Whoaa guys! That's it!
Well done, and the core of it is basically only about ~10 lines...
Thanks! This will be very useful to signal certain state changes of a script to the user.
Cheers David.P |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|