Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetTitleMatchMode, 2
- GroupAdd, Gui_Blank, ahk_class AutoHotkeyGUI
- GroupAdd, Gui_Blank, BlankScr.ahk
- !^9::
- count++
- global m := mod(count,2)
- mvmouse(m)
- return
- ^F12::
- Run, C:\Users\Suhas\Desktop\BlankScr.ahk
- SystemCursor("Off")
- mbak := m
- SoundBeep
- WinWaitActive, ahk_group Gui_Blank
- mvmouse(1)
- SoundBeep
- WinWaitNotActive, ahk_group Gui_Blank
- SoundBeep
- mvmouse(mbak)
- SystemCursor("On")
- return
- SystemCursor(OnOff=1) ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
- {
- static AndMask, XorMask, $, h_cursor
- ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
- , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13 ; blank cursors
- , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13 ; handles of default cursors
- if (OnOff = "Init" or OnOff = "I" or $ = "") ; init when requested or at first call
- {
- $ := "h" ; active default cursors
- VarSetCapacity( h_cursor,4444, 1 )
- VarSetCapacity( AndMask, 32*4, 0xFF )
- VarSetCapacity( XorMask, 32*4, 0 )
- system_cursors := "32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650"
- StringSplit c, system_cursors, `,
- Loop %c0%
- {
- h_cursor := DllCall( "LoadCursor", "Ptr",0, "Ptr",c%A_Index% )
- h%A_Index% := DllCall( "CopyImage", "Ptr",h_cursor, "UInt",2, "Int",0, "Int",0, "UInt",0 )
- b%A_Index% := DllCall( "CreateCursor", "Ptr",0, "Int",0, "Int",0
- , "Int",32, "Int",32, "Ptr",&AndMask, "Ptr",&XorMask )
- }
- }
- if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
- $ := "b" ; use blank cursors
- else
- $ := "h" ; use the saved cursors
- Loop %c0%
- {
- h_cursor := DllCall( "CopyImage", "Ptr",%$%%A_Index%, "UInt",2, "Int",0, "Int",0, "UInt",0 )
- DllCall( "SetSystemCursor", "Ptr",h_cursor, "UInt",c%A_Index% )
- }
- }
- mvmouse(val)
- {
- valm := mod(val, 2)
- if(valm = 1)
- {
- SetTimer, MoveMouse,
- MoveMouse:
- If ( A_TimeIdle > 59000 )
- {
- MouseMove, 1, 0,, R
- MouseMove, -1, 0,, R
- }
- return
- }
- Return
- }
- C:\Users\Suhas\Desktop\BlankScr.ahk is a separate script whose contents are pasted below.
- Gui, Color, black
- Gui +AlwaysOnTop
- Gui -Caption
- Gui, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%
- return
- esc::exitapp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement