Andrew Peacock Posted August 6, 2009 Share Posted August 6, 2009 Hi all, I'm trying to bundle a couple of files into an .exe - one .ico file and one .png file To compile the files, I think I need to do something like: #AutoIt3Wrapper_Res_Icon_Add=c:\path\to\icon\on\build\machine\file.ico #AutoIt3Wrapper_Res_Icon_Add=c:\path\to\icon\on\build\machine\file.png But how do I reference those files in the actual script itself? Regards, Andy Link to comment Share on other sites More sharing options...
Developers Jos Posted August 6, 2009 Developers Share Posted August 6, 2009 Have a look in the SciTE4AutoIt3 helpfile that comes with that installer package. You will find an example in the Helppage on AutoIt3Wrapper. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Andrew Peacock Posted August 6, 2009 Author Share Posted August 6, 2009 Have a look in the SciTE4AutoIt3 helpfile that comes with that installer package. You will find an example in the Helppage on AutoIt3Wrapper. Jos Hi Jos, Been there, done that, but thanks for suggesting it. I found out by trial and error that part of the problem is I'm trying to include PNG. That just crashes the compiler. But if I take that out, and then use TraySetIcon() without an index, that seems to pull the one icon I'm including in this program. So far, so good. It's the PNG that's got me thrown - how do I add that without breaking the compiler, and then reference it. The sample code that I've got BEFORE trying to use resources is: #include <_Icons.au3> ; Add the on-gui icon $filePng = @scriptdir & "\forumsaver.png" $picIcon = GUICtrlCreatePic('', 300, 50, 64, 64) _SetImage($picIcon, $filePng) But I'm now stumped on how to include the PNG. I tried running the resource hacker au3 script which is popular here. It asked for the script that I wanted to hack, and then it just ran that script. So nothing useful came out of that. Andy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 6, 2009 Moderators Share Posted August 6, 2009 (edited) Andrew Peacock,Part of the problem may be because you trying to use #AutoIt3Wrapper_Res_Icon_Add to load a .png! If you were to use #AutoIt3Wrapper_Res_File_Add you might have more luck. One small word of warning - just ignore the optional elements of the directive "Filename[,Section [,ResName]] to be added". Autoit3Wrapper only stores things in the RC_DATA resource area and numbers them consecutively. So your .png will be known as "1" regardless. Jos did a wonderful job of getting the resource load into Autoit3Wrapper but that bit did not work properly - but he knows we are grateful for the rest!Personally, for that and some other reasons, I tend to use Zedna's wonderful Resources.au3. The UDF can be found here, but do pay close attention to the examples - play around with them until you understand how the UDF works. Once you have it mastered it is very powerful.UDF syntax runs like this:1. Get the resource in: #AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, file_name, rcdata, MY_PIC, 02. Create the pic control: $Pic = GUICtrlCreatePic("", 10, 200, 25, 25)3. Show resouce: _ResourceSetImageToCtrl($Pic, "MY_PIC")Cannot get much easier than that!Try it out and see how you get on. The topic is long, I know, but crammed with good tips on how to get the best from it - well worth the effort of learning how to use it properly. Good luck!M23Edit: Speeling as ever >_< Edited August 6, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Andrew Peacock Posted August 12, 2009 Author Share Posted August 12, 2009 Hi Melba, Sorry, I didn't get back to say thanks. So... Thanks! I got it working with your guidance, Regards, Andy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now