Page 1 of 1

mousey - change the cursor

Posted: 19 Jun 2015, 10:01
by BGM
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

Re: mousey - change the cursor

Posted: 19 Jun 2015, 10:23
by TheDewd
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.

Re: mousey - change the cursor

Posted: 19 Jun 2015, 10:57
by BGM
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.

Re: mousey - change the cursor

Posted: 20 Jun 2015, 04:38
by just me
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.