Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=Visualpharm-Icons8-Metro-Style-Very-Basic-Cursor.ico
- #AutoIt3Wrapper_Res_Description=Hides Cursor (CTRL+F5)
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
- ;Copyright RGSOFTWARE
- ;RICCARDO FRANCESCO GERACI
- #AutoIt3Wrapper_Res_LegalCopyright=RGSoftware
- #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- ;HotKeySet('{Esc}', 'End')
- $Hotkey = "CTRL+F5"
- HotKeySet("^{F5}", "exe")
- #include <TrayConstants.au3>
- #include <FileConstants.au3>
- #include <File.au3>
- #include <misc.au3>
- Global Const $USER32 = DllOpen("user32.dll")
- Global Const $cDir = 'C:\Windows\Cursors' ; Cursor Dir for vista and win7
- Global Const $Cursor = $cDir & '\blank.cur' ;Cursor that it will change to
- Global Const $CursorBack = $cDir & '\aero_arrow.cur'
- Global $bOn = False
- Global $Installed = False
- Global $addedToStartup = False
- checkFileExists()
- AddToStartUp()
- TrayTip("Hide Cursor Tip", "When you want to hide/unhide cursor, just press " & $Hotkey, 5)
- If _Singleton("Hide Cursor", 1) = 0 Then
- MsgBox(0, "Warning", "You may only run one instance at a time!" & @CRLF & "-Ric")
- Exit
- EndIf
- func GetFilename($psFilename)
- local $szDrive, $szDir, $szFName, $szExt
- _PathSplit($psFilename, $szDrive, $szDir, $szFName, $szExt)
- return $szFName
- EndFunc
- func GetExtension($psFilename)
- local $szDrive, $szDir, $szFName, $szExt
- _PathSplit($psFilename, $szDrive, $szDir, $szFName, $szExt)
- return $szExt
- EndFunc
- Func AddToStartUp()
- If FileExists(@ScriptFullPath) Then
- $fileloc = "C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
- If FileExists($fileloc) Then
- FileCopy(@ScriptFullPath, $fileloc & "\" & GetFilename(@ScriptFullPath) & GetExtension(@ScriptFullPath))
- $addedToStartup = True
- EndIf
- EndIf
- EndFunc ;==>AddToStartUp
- Func checkFileExists()
- Local $curfolder = "C:\Windows\Cursors"
- If FileExists($curfolder) then
- If Not FileExists($curfolder & "\blank.cur") Then
- If FileExists(@ScriptDir & "\blank.cur") Then
- FileCopy(@ScriptDir & "\blank.cur", $curfolder & "\blank.cur")
- $Installed = True
- Else
- MsgBox(0, "Cursor Error", "Blank Cursor Cannot Be Located!")
- $Installed = False
- exit
- EndIf
- Else
- $Installed = True
- EndIf
- Else
- MsgBox(0,"","Cursors folder cannot be located in " & $curfolder)
- endif
- EndFunc ;==>checkFileExists
- Func exe()
- $bOn = Not $bOn
- If $bOn And $Installed = True Then
- MouseSetCursor($Cursor) ;Set Cursor
- TrayTip("Cursor Hidden", "You Have Hidden The Cursor. Press " & $Hotkey & " To Unhide", 5)
- Else
- MouseSetCursor($CursorBack)
- TrayTip("Cursor Visible", "Your Cursor Is Visible. Press " & $Hotkey & " To Hide", 5)
- EndIf
- EndFunc ;==>exe
- While 1
- Sleep(10)
- WEnd
- Func MouseSetCursor($nCursor)
- ;Load
- $cDll = DllCall($USER32, "hwnd", "LoadCursorFromFile", "str", $nCursor)
- If @error <> 0 Then Return
- ;Change
- DllCall($USER32, "int", "SetSystemCursor", "int", $cDll[0], "int", 32512)
- If @error <> 0 Then Return
- EndFunc ;==>MouseSetCursor
- ;Func End()
- ;MouseSetCursor($CursorBack)
- ;Exit
- ;EndFunc ;==>End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement