Skip to content

Commit

Permalink
Use a copy of the cursor handle to prevent cursor cycling
Browse files Browse the repository at this point in the history
  • Loading branch information
lu0 committed Jan 18, 2024
1 parent fce6d5b commit e4629b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions miscellaneous/screenshot.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ setPlusCursor() {
, OCR_UP: 32516 ; Alternate select
, OCR_WAIT: 32514 } ; Busy

IMAGE_CURSOR := 2
typeOfImageToCopy := IMAGE_CURSOR

for cursorName, cursorId in systemCursors {
plusCursorHandle := DllCall("LoadCursor", UInt, 0, Int, systemCursors["OCR_CROSS"])
if (cursorId != OCR_CROSS) {
DllCall("SetSystemCursor", Ptr, plusCursorHandle, UInt, cursorId)
}
plusCursorCopy := DllCall("CopyImage", Ptr, plusCursorHandle, UInt, typeOfImageToCopy, Int, 0, Int, 0, UInt, 0)
DllCall("SetSystemCursor", Ptr, plusCursorCopy, UInt, cursorId)
}

return
Expand Down

0 comments on commit e4629b7

Please sign in to comment.