Sign in to follow this  
Followers 0
aNewLyfe

Guictrlseticon()

6 posts in this topic

is there any way to set a cursor from file ?

i mean : GUISetCursor(@ScriptDir&"\cursors\mainwinCursor.cur",0,$mainwin)

thanks for your helps <_<


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites



is there any way to set a cursor from file ?

i mean : GUISetCursor(@ScriptDir&"\cursors\mainwinCursor.cur",0,$mainwin)

thanks for your helps <_<

No, you can't load external cursor with standard methods. But I posted Window Finder code couple days ago, there you can found example, how to load cursor from the *.cur file.

http://www.autoitscript.com/forum/index.php?showtopic=55934

Share this post


Link to post
Share on other sites

No, you can't load external cursor with standard methods. But I posted Window Finder code couple days ago, there you can found example, how to load cursor from the *.cur file.

http://www.autoitscript.com/forum/index.php?showtopic=55934

tnx for the fast answer. ill chek that ty. <_<


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

In Autoit Wrappers

; Set Mouse Cursor Style
; Author - gafrost

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(@WindowsDir & "\cursors\banana.ani", $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

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

In Autoit Wrappers

; Set Mouse Cursor Style
; Author - gafrost

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(@WindowsDir & "\cursors\banana.ani", $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

8)

THis is good! I wonder if we can get this for the build?

Share this post


Link to post
Share on other sites

8)

thnks valuater that script rocks <_<


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0