Sign in to follow this  
Followers 0
DarkBoost

Compile ICO in EXE and then Reference this

8 posts in this topic

I create a simple GUI and include an ICO file to be compiled to an EXE. Using a 3rd Party Application I see that this is icon 5/5 so I reference in the GUI - GUICtrlCreateIcon but it fails to acknowledge this. Is there something I am doing wrong?

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=example.exe
#AutoIt3Wrapper_Res_Icon_Add=c:\files\example.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

#Include <GUIConstantsEx.au3>

GUICreate("", 150, 150)
GUICtrlCreateIcon("c:\files\example.exe", 5, 20, 20)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites



I create a simple GUI and include an ICO file to be compiled to an EXE. Using a 3rd Party Application I see that this is icon 5/5 so I reference in the GUI - GUICtrlCreateIcon but it fails to acknowledge this. Is there something I am doing wrong?

Try this:

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_outfile=example.exe
#AutoIt3Wrapper_Res_Icon_Add=c:\files\example.ico
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****

#Include <GUIConstantsEx.au3>

GUICreate("", 150, 150)
GUICtrlCreateIcon("c:\files\example.exe", 4, 20, 20)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

First icon is addressed as zero, so if you have 5 icons in your file, 5th is actually 4th.

As in arrays.


I can do signature me.

Share this post


Link to post
Share on other sites

Still no luck - here is an example :D

post-24114-1244801041_thumb.jpg

Share this post


Link to post
Share on other sites

yes i have... the helpfile is not as intuitive as it may appear to some and its a horrible feeling to try and understand this then ask for help then to be told to read it again :D

Share this post


Link to post
Share on other sites

Opt("GUICoordMode",1)

GUICreate("My GUI icon Race", 350,74,-1,-1)
GUICtrlCreateLabel ("", 331,0,1,74,5)
$n1=GUICtrlCreateIcon ( @AutoItExe, -4, 0,0,32,32)
$n2=GUICtrlCreateIcon ( @AutoItExe, -3, 0,40,32,32)

GUISetState (@SW_SHOW)

Dim $a = 0, $b = 0
While ($a < 300) And ($b < 300)
  $a = $a + int(Random(0,1)+0.5)
  $b = $b + int(Random(0,1)+0.5)
  GUICtrlSetPos($n1, $a,0)
  GUICtrlSetPos($n2, $b,40)
  Sleep(20)
WEnd
sleep(1000)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

yes i have... the helpfile is not as intuitive as it may appear to some and its a horrible feeling to try and understand this then ask for help then to be told to read it again :D

Which helpfile did you look?

There is an extensive example of exactly what you want it the SciTE4AutoIt3 (Ctrl+F1) helpfile under AutoIt3Wrapper.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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