Results 1 to 7 of 7

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

  1. #1
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448

    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. #2
    MGD
    MGD is offline
    FLAC
    Auto Apps:loading...
    MGD's Avatar
    Join Date
    Feb 2005
    Location
    Los Angeles
    Posts
    1,756
    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.

  3. #3
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    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

  4. #4
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    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

  5. #5
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,723
    Blog Entries
    1
    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

  6. #6
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    Quote 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

  7. #7
    Super Moderator
    Auto Apps:loading...
    JohnWPB's Avatar
    Join Date
    Sep 2005
    Location
    West Palm Beach, Florida
    Posts
    4,723
    Blog Entries
    1
    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

Similar Threads

  1. Mouse Cursor
    By GARB-E in forum WinNT Based
    Replies: 8
    Last Post: 10-23-2005, 01:53 PM
  2. getting rid of the mouse cursor
    By ummagawd in forum FrodoPlayer
    Replies: 10
    Last Post: 05-11-2005, 08:33 AM
  3. Xenarc mouse cursor positioning bug?
    By wysocki in forum Input Devices
    Replies: 2
    Last Post: 05-12-2004, 11:22 PM
  4. Auto-hide mouse cursor?
    By burnout.no in forum Software & Software Development
    Replies: 2
    Last Post: 01-08-2004, 08:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •