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 

Flash a red circle where the cursor is

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
David.P



Joined: 18 Nov 2006
Posts: 237

PostPosted: Fri Nov 20, 2009 10:09 am    Post subject: Flash a red circle where the cursor is Reply with quote

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
View user's profile Send private message
hugov



Joined: 27 May 2007
Posts: 2181

PostPosted: Fri Nov 20, 2009 10:28 am    Post subject: Reply with quote

Yes, there are various scripts on the forum and I think skrommel has one too (see his page at donationcoder, google it)
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 11:14 am    Post subject: Reply with quote

Check out here
_________________
AutoHotFile - ToolTip(n,text,title,options) Wink
Back to top
View user's profile Send private message
David.P



Joined: 18 Nov 2006
Posts: 237

PostPosted: Fri Nov 20, 2009 11:24 am    Post subject: Reply with quote

Uaahh thanks that's amazing....!

Me hovewer was more like looking for a "two lines of code" solution for a simple circle... Embarassed Embarassed

Is that possible -- maybe with a simple GUI command and then WinSet Region, or something...........?

Thanks David.P
Back to top
View user's profile Send private message
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 11:26 am    Post subject: Reply with quote

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) Wink
Back to top
View user's profile Send private message
hugov



Joined: 27 May 2007
Posts: 2181

PostPosted: Fri Nov 20, 2009 11:55 am    Post subject: Reply with quote

http://www.donationcoder.com/Software/Skrommel/index.html#MouseMark exe and source and I'm sure there are other solutions posted on the forum
_________________
Tut 4 Newbies
TF : Text file & string lib, TF Forum
Back to top
View user's profile Send private message Visit poster's website
David.P



Joined: 18 Nov 2006
Posts: 237

PostPosted: Fri Nov 20, 2009 12:11 pm    Post subject: Reply with quote

Thanks -- that's hovewer another 250 lines and I don't even find the relevant ones that actually draw the thing Embarassed

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 Shocked
Back to top
View user's profile Send private message
doyle



Joined: 14 Nov 2007
Posts: 279
Location: London, England

PostPosted: Fri Nov 20, 2009 12:15 pm    Post subject: Reply with quote

God forbid!

And good luck with doing this in 2 lines.
Back to top
View user's profile Send private message Visit poster's website
hugov



Joined: 27 May 2007
Posts: 2181

PostPosted: Fri Nov 20, 2009 12:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 12:36 pm    Post subject: Reply with quote

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) Wink
Back to top
View user's profile Send private message
doyle



Joined: 14 Nov 2007
Posts: 279
Location: London, England

PostPosted: Fri Nov 20, 2009 3:30 pm    Post subject: Reply with quote

Mine doesnt move with the mouse.

Is it meant to?
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 7698
Location: Germany (but I only speak English)

PostPosted: Fri Nov 20, 2009 3:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jaco0646



Joined: 07 Oct 2006
Posts: 1770
Location: MN, USA

PostPosted: Fri Nov 20, 2009 3:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
HotKeyIt



Joined: 18 Jun 2008
Posts: 1994
Location: GERMANY

PostPosted: Fri Nov 20, 2009 4:29 pm    Post subject: Reply with quote

I did too Smile
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) Wink
Back to top
View user's profile Send private message
David.P



Joined: 18 Nov 2006
Posts: 237

PostPosted: Fri Nov 20, 2009 4:50 pm    Post subject: Reply with quote

Whoaa guys! That's it! Shocked Shocked Cool

Well done, and the core of it is basically only about ~10 lines... Smile

Thanks! This will be very useful to signal certain state changes of a script to the user.

Cheers David.P
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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