Mouse Pointer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ninacollins
Posts: 2
Joined: 13 Jun 2018, 15:48

Mouse Pointer

13 Jun 2018, 16:55

Hi,

I would like to create a small script for turning on/off mouse pointer to "Laser Pointer". Can anyone help me to create this script?

I have tried below script, I am able to change mouser pointer to selected cur file.

Code: Select all

Gui, new
Gui, Show,w400 h300,%applicationname% Test
Gui, Add, Button, Default, OK
ButtonOK:
cursorPath.="C:\Users\admin\Desktop\laser_cursor_red.cur"
hCursor:=DllCall("LoadCursorFromFile","Str",cursorPath)
DllCall("SetSystemCursor","UInt", hCursor, "UInt", 32512)
Return
please place your code in [code][/code] tags!

Instead of OK button, I would like to change to a check box. If check box is enabled, load give .cur file, otherwise system pointer typ.

Thanks,
Nina
ninacollins
Posts: 2
Joined: 13 Jun 2018, 15:48

Re: Mouse Pointer

15 Jun 2018, 16:42

Hi All,

I have made some more modification to this script,but still it is not fixing my issues.

====================================================
Gui, new
Gui, Show,w400 h300,%applicationname% Test

Gui, Add, Button, Default, LASER
Gui, Add, Button, Default, DEFAULT
Return

ButtonLASER:

cursorPath.="C:\Users\admin\Desktop\laser_cursor_red.cur"
hCursor:=DllCall("LoadCursorFromFile","Str",cursorPath)
DllCall("SetSystemCursor","UInt", hCursor, "UInt", 32512)
Return

ButtonDEFAULT:
DllCall("LoadCursor", "ptr", 0, "ptr", 32512)
Return

GuiClose:
ExitApp
return
========================================================

I would like to load the image from where the script (exe) is saved. And I need to bring back normal default mouse pointer. At least I get these 2 answers, I will be really happy.

Thanks,
Nina

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 249 guests