mousey - change the cursor

Post your working scripts, libraries and tools
User avatar
BGM
Posts: 419
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

mousey - change the cursor

19 Jun 2015, 10:01

Do you want to easily change the mouse cursor when you move the mouse over a control?
Enter mousey!

All you have to do is to create a new mousey handle.

Example

Code: Select all

;mousey example
;sample change of mouse cursor on mouseover
#SingleInstance, On
#NoEnv
SetBatchLines, -1
gui, add, text, hwndmouseytext,Mousey Crosshairs
gui, add, button, gguiclose,EXIT (non-mousey)
gui, add, text, hwndhandytext,Mouse Hand
mousey_cursor := mousey_init(mouseytext,"crosshair")
handy_cursor := mousey_init(handytext,"hand")
gui, show
return

guiclose:
	mousey_close(mousey_cursor)
	mousey_close(handy_cursor)
	exitapp
return
mousey library
Spoiler
User avatar
TheDewd
Posts: 1112
Joined: 19 Dec 2013, 11:16
Location: USA

Re: mousey - change the cursor

19 Jun 2015, 10:23

Sometimes it will flicker while moving the mouse across a control, and both the new cursor and the default cursor can be seen at the same time.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
BGM
Posts: 419
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: mousey - change the cursor

19 Jun 2015, 10:57

Well, I guess I'll have to work on that part...
It seems to flicker more with the crosshairs than with the hand cursor, though.
just me
Posts: 5515
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: mousey - change the cursor

20 Jun 2015, 04:38

You might be interested in the WM_SETCURSOR notification. For static controls like Text and Pic the notification will be received only if the control has a g-label or the SS_NOTIFY (+0x0100) style.

Return to “Scripts and Functions”

Who is online

Users browsing this forum: arcticir, Blackholyman, robmar-zl, roysubs and 23 guests