Announcement

Collapse
No announcement yet.

Is there a command available to "unhide" the mouse cursor...

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a command available to "unhide" the mouse cursor...

    ...after RR has loaded?

    Generally, I like having the mouse hidden, but some embedded apps, such as my OBD program, just needs a mouse/keyboard combo.

    Is there a way to unhide it, then hide it again during runtime?
    Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

  • #2
    You can do it with an easy autoit script with iniRead and change the lines
    Hidemouse=true
    Hidemouse=false

    Let me know if you need it, I can write it up for you.

    Comment


    • #3
      I'm familiar w/ the IniRead & IniWrite function in AI.

      I need something that will unhide the cursor when I need it, then command it to hide when I'm done.

      Is that something you could help me out with?
      Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

      Comment


      • #4
        NVM.

        Finally found an existing script in the AI forums that changes the cursor runtime.

        Code:
        Global Const $OCR_APPSTARTING = 32650
        Global Const $OCR_NORMAL = 32512
        Global Const $OCR_CROSS = 32515
        Global Const $OCR_HAND = 32649
        Global Const $OCR_IBEAM = 32513
        Global Const $OCR_NO = 32648
        Global Const $OCR_SIZEALL = 32646
        Global Const $OCR_SIZENESW = 32643
        Global Const $OCR_SIZENS = 32645
        Global Const $OCR_SIZENWSE = 32642
        Global Const $OCR_SIZEWE = 32644
        Global Const $OCR_UP = 32516
        Global Const $OCR_WAIT = 32514
        
        ;~ _SetCursor(@WindowsDir & "\cursors\3dgarro.cur", $OCR_NORMAL)
        ;~ _SetCursor(@WindowsDir & "\cursors\3dwarro.cur", $OCR_NORMAL)
        _SetCursor("C:\Program Files\Road Runner\normal.cur", $OCR_NORMAL)
        
        ;==================================================================
        ; $s_file - file to load cursor from
        ; $i_cursor - system cursor to change
        ;==================================================================
        Func _SetCursor($s_file, $i_cursor)
           Local $newhcurs, $lResult
           $newhcurs = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $s_file)
           If Not @error Then
              $lResult = DllCall("user32.dll", "int", "SetSystemCursor", "int", $newhcurs[0], "int", $i_cursor)
              If Not @error Then
                 $lResult = DllCall("user32.dll", "int", "DestroyCursor", "int", $newhcurs[0])
              Else
                 MsgBox(0, "Error", "Failed SetSystemCursor")
              EndIf
           Else
              MsgBox(0, "Error", "Failed LoadCursorFromFile")
           EndIf
        EndFunc  ;==>_SetCursor
        Did a quick test to see if works in RR and it does.

        Going to elaborate it a bit to allow to hide and unhide the cursor now.

        Thx anyway.

        Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

        Comment


        • #5
          Thats pretty cool, what are you using to tell it to hide the cursor though? The script above lets you chance it to another one, but not hide it from what I can see.
          Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

          My Fiero Build Thread

          Comment


          • #6
            Originally posted by JohnWPB View Post
            Thats pretty cool, what are you using to tell it to hide the cursor though? The script above lets you chance it to another one, but not hide it from what I can see.
            Yeah. That was just a straight cut and paste from the AI forums that allows you to set a cursor.

            Here's what I put together to be used in RR to use the .cur files already in the RR directory:

            cursor.au3 code:
            Code:
            #comments-start
            
            Hides/Unhides mouse cursor during runtime
            
            
            
            Author: Sal R.
            
            #comments-end
            
            Global Const $OCR_APPSTARTING = 32650
            Global Const $OCR_NORMAL = 32512
            Global Const $OCR_CROSS = 32515
            Global Const $OCR_HAND = 32649
            Global Const $OCR_IBEAM = 32513
            Global Const $OCR_NO = 32648
            Global Const $OCR_SIZEALL = 32646
            Global Const $OCR_SIZENESW = 32643
            Global Const $OCR_SIZENS = 32645
            Global Const $OCR_SIZENWSE = 32642
            Global Const $OCR_SIZEWE = 32644
            Global Const $OCR_UP = 32516
            Global Const $OCR_WAIT = 32514
            
            ;Open coms w/ RR
            $rr = ObjCreate("RoadRunner.sdk")
            
            ;rr's install directory
            $rrpath = $rr.getinfo("RRPATH")
            
            ;Get command info from RR
            $viewOpt = $cmdlineraw
            
            Switch $viewOpt
            	Case "hide"
            		_SetCursor($rrpath & "null.cur", $OCR_NORMAL)
            		
            	Case "unhide"
            		_SetCursor($rrpath & "normal.cur", $OCR_NORMAL)
            		
            EndSwitch
            	
            	
            ;==================================================================
            ; $s_file - file to load cursor from
            ; $i_cursor - system cursor to change
            ;==================================================================
            Func _SetCursor($s_file, $i_cursor)
               Local $newhcurs, $lResult
               $newhcurs = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $s_file)
               If Not @error Then
                  $lResult = DllCall("user32.dll", "int", "SetSystemCursor", "int", $newhcurs[0], "int", $i_cursor)
                  If Not @error Then
                     $lResult = DllCall("user32.dll", "int", "DestroyCursor", "int", $newhcurs[0])
                  Else
                     MsgBox(0, "Error", "Failed SetSystemCursor")
                  EndIf
               Else
                  MsgBox(0, "Error", "Failed LoadCursorFromFile")
               EndIf
            EndFunc  ;==>_SetCursor
            RR commands:
            Code:
            "RUN;<path to script above>cursor.exe|hide"
            "RUN;<path to script above>cursor.exe|unhide"
            Pico-ITX / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

            Comment


            • #7
              Learn something new every day! Was not even aware of the existance of the null cursor in the RR dir! Cool......
              Front End of Choice: Ride Runner (Is there anything else??? ) & Powered by the DFX5.1 Skin Available in the Mobile App Mart

              My Fiero Build Thread

              Comment

              Working...
              X