I need help embedding cursor images in a compiled exe file. I tried several #AutoIt3Wrapper definitions, but I could not figure out how to use the embedded cursor image to change the visible cursor.
Here is my test code (modified, from the SciTE help file):
; Add icons to the file resource table
; As no resource names are specified, they will be set automatically to 201+
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\MyAutoIt3_Blue.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Icons\MyAutoIt3_Red.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Program Files\AutoIt3\Examples\Helpfile\Extras\Lens.cur
#AutoIt3Wrapper_Res_Icon_Add=C:\Windows\Cursors\up_il.cur
_Main()
Func _Main()
Local $str, $hGUI, $cButton, $cLabel, $rc2
; Create the GUI
$hGUI = GUICreate("Demo icon resources")
$cButton = GUICtrlCreateButton("", 10, 10, 40, 40, 0x0040) ; 0x0040 Specifies that the button displays an icon
$cLabel = GUICtrlCreateLabel("", 70, 25, 200, 20)
GUISetState(@SW_SHOW, $hGUI)
For $x = 201 To 204 ; Run through the added icons in the resource table
$rc2 = GUICtrlSetImage($cButton, @ScriptFullPath, $x) ; Change the icon in the button
GUICtrlSetData($cLabel, "Icon Name: " & $x)
$str = "Added icon: " & $x & ", GUICtrlSetImage rc2: " & $rc2
logMsg($str)
; TBD ... set the cursor from image embedded in the exe file
Sleep(2000) ; Allow time for icon/cursor to be seen
Next
; Delete the GUI
GUIDelete($hGUI)
EndFunc ;==>_Main
Func logMsg($msg, $lnum = @ScriptLineNumber)
ConsoleWrite("+++:" & $lnum & ": " & $msg & @CRLF)
EndFunc ;==>logMsg