| 
          #SingleInstance, force | 
        
        
           | 
          #Persistent | 
        
        
           | 
          
 | 
        
        
           | 
          Menu, Tray, NoIcon | 
        
        
           | 
          
 | 
        
        
           | 
          bool := 1 | 
        
        
           | 
          ; Reference: Language Identifier Constants and Strings | 
        
        
           | 
          ; https://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx | 
        
        
           | 
          lang := 0x4090409 ; English | 
        
        
           | 
          
 | 
        
        
           | 
          
 | 
        
        
           | 
          ; Paths for Windows Black (system scheme) cursors | 
        
        
           | 
          ; May vary between Windows versions, make sure these exist | 
        
        
           | 
          blackIBeam = `%SystemRoot`%\cursors\beam_r.cur | 
        
        
           | 
          blackArrow = `%SystemRoot`%\cursors\arrow_r.cur | 
        
        
           | 
          blackAppStarting = `%SystemRoot`%\cursors\busy_r.cur | 
        
        
           | 
          blackCrosshair = `%SystemRoot`%\cursors\cross_r.cur | 
        
        
           | 
          blackHelp = `%SystemRoot`%\cursors\help_r.cur | 
        
        
           | 
          blackWait = `%SystemRoot`%\cursors\wait_r.cur | 
        
        
           | 
          blackSizeNESW = `%SystemRoot`%\cursors\move_r.cur | 
        
        
           | 
          
 | 
        
        
           | 
          SetTimer, CheckLang, 200 | 
        
        
           | 
          
 | 
        
        
           | 
          CheckLang: | 
        
        
           | 
            Suspend, Permit | 
        
        
           | 
            if(lang = Format("0x{:x}", DllCall("GetKeyboardLayout", "Int", DllCall("GetWindowThreadProcessId", "Int", WinActive("A"), "Int", 0)))) { | 
        
        
           | 
              if(bool) { | 
        
        
           | 
                ; English keyboard layout | 
        
        
           | 
                ; Reset to default (empty string) | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, IBeam, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Arrow, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, AppStarting, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Crosshair, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Help, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Wait, | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, SizeNESW, | 
        
        
           | 
                ; Make it stick | 
        
        
           | 
                setCursors() | 
        
        
           | 
                bool := False | 
        
        
           | 
              } | 
        
        
           | 
            } else { | 
        
        
           | 
              if(!bool) { | 
        
        
           | 
                ; Non-English keyboard layout | 
        
        
           | 
                ; Set black cursors individually because you can't set the scheme | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, IBeam, %blackIBeam% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Arrow, %blackArrow% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, AppStarting, %blackAppStarting% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Crosshair, %blackCrosshair% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Help, %blackHelp% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, Wait, %blackWait% | 
        
        
           | 
                RegWrite, REG_EXPAND_SZ, HKEY_CURRENT_USER, Control Panel\Cursors, SizeNESW, %blackSizeNESW% | 
        
        
           | 
                ; Make it stick | 
        
        
           | 
                setCursors() | 
        
        
           | 
                bool := True | 
        
        
           | 
              } | 
        
        
           | 
            } | 
        
        
           | 
          return | 
        
        
           | 
          
 | 
        
        
           | 
          setCursors() { | 
        
        
           | 
            SPI_SETCURSORS := 0x57 | 
        
        
           | 
            result := DllCall("SystemParametersInfo", "UInt", SPI_SETCURSORS, "UInt", 0, "UInt", 0, "UInt", 0) | 
        
        
           | 
          } |