Jump to content

Recommended Posts

Why not embed the icon into you compiled script and associate it as required, alternatively you could also compile an image into your executable (see example below):

Note requires Zednas excellent resources UDF https://www.autoitscript.com/forum/topic/51103-resources-udf/

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Program Files (x86)\AutoIt3\Beta\Examples\Helpfile\Extras\Soccer.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_File_Add=C:\Program Files (x86)\AutoIt3\Examples\GUI\logo4.gif,10,idButtonImage
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <GUIConstantsEx.au3>
#include <Resources.au3> ;~ Created by Zedna download from https://www.autoitscript.com/forum/topic/51103-resources-udf/

Example()

Func Example()
    Local $hGUI = GUICreate("Example", 189, 88)
    Local $idButton = GUICtrlCreateButton("", 10, 10, 169, 68)
    _ResourceSetImageToCtrl($idButton, "idButtonImage")

    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idButton
                MsgBox(4096, "Button Click", "Button Clicked")
        EndSwitch
    WEnd
    GUIDelete($hGUI)
EndFunc   ;==>Example

 

Edited by Subz
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...