vagabond719 Posted July 12, 2017 Share Posted July 12, 2017 (edited) I have added icons as resources. The issue I am having is after the EXE is created the icons are all smaller. They are correct size prior to being compiled. Is there something I am missing? I am only showing snippets below. #AutoIt3Wrapper_Res_Icon_Add=C:\Users\xxxxxx\Documents\AutoIt\images\microsoft_access.ico If @Compiled Then $accessICO = @ScriptFullPath $accessICO_id = 201 Else $accessICO = @ScriptDir & "\images\microsoft_access.ico" $accessICO_id = 1 EndIf $accessButton = GUICtrlCreateButton("Access", $col1, $row1, $iconH, $iconW, $BS_ICON) GUICtrlSetImage(-1, $accessICO, $accessICO_id) GUICtrlSetTip(-1, "Build the Access DB", "Button Description", 1, 1) Edited July 12, 2017 by vagabond719 Link to comment Share on other sites More sharing options...
Neutro Posted July 12, 2017 Share Posted July 12, 2017 (edited) Hi, It's hard to see what's wrong if you dont post your entire GUI and the icon file! We can't test anything with only the snippet you posted. Edited July 12, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
vagabond719 Posted July 12, 2017 Author Share Posted July 12, 2017 Here is the code file and images folder. The only thing I have changed is the network folders. EOR.zip Link to comment Share on other sites More sharing options...
Neutro Posted July 12, 2017 Share Posted July 12, 2017 (edited) I'm also having the same problem, it's really strange Working on it Edited July 12, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Trong Posted July 12, 2017 Share Posted July 12, 2017 (edited) Use FileInstall Edited July 13, 2017 by Trong Regards, Link to comment Share on other sites More sharing options...
Neutro Posted July 12, 2017 Share Posted July 12, 2017 (edited) No it's not working properly Trong The icon size in ressource hacker is 64x64, the icon size in the compiled exe shown in your screenshot is 32x32. If it was working properly the image in each buttons of the software should have the full button size and not just show in the middle as 32x32. I think it's a bug from the GUICtrlSetImage function. Try it out with this code: #Region ;************ Includes ************ #include <GUIConstantsEx.au3> #include <GuiButton.au3> #EndRegion ;************ Includes ************ $test = GUICreate("test", 600, 300) Global $hIcon1 = GUICtrlCreateIcon("", Default, 20, 20, 240, 240) Global $button1 = GUICtrlCreateButton("", 300, 20, 240, 240, $BS_ICON ) GUICtrlSetImage($hIcon1, "shell32.dll", 22) GUICtrlSetImage($button1, "shell32.dll", 22) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd When GuiCtrlSetImage is used on an icon it uses the biggest size possible whereas when used on a button it uses 32x32 or 16x16 only. Edited July 12, 2017 by Neutro vagabond719 1 Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
orbs Posted July 12, 2017 Share Posted July 12, 2017 this is a known issue and will not be fixed. see Trac ticket. workaround: use only 32x32 icons. and in this case, it will make the GUI look a lot nicer. just make the buttons slightly smaller. and in general, try to use a more consistent icon design for grouped buttons of similar functionality. vagabond719 and Neutro 2 Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Neutro Posted July 12, 2017 Share Posted July 12, 2017 (edited) As explained here you can solve this problem using ResourcesEX.au3 Changes made to your script were using this AutoIt3Wrapper to add icon files: #AutoIt3Wrapper_Res_File_Add=images\unix_vvw_icon.ico, RT_ICON, UNIX, 0 and this function to set the icon in the button when using compiled script: _Resource_SetToCtrlID(-1, 'UNIX', $RT_ICON) You need to put the attached file ResourcesEx.au3 in your AutoIT\include folder for this to work. A working version can be found in the EOR.zip filed joined as well. Enjoy Edited July 12, 2017 by Neutro vagabond719 1 Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
vagabond719 Posted July 12, 2017 Author Share Posted July 12, 2017 6 minutes ago, Neutro said: As explained here you can solve this problem using ResourcesEX.au3 Changes made to your script were using this AutoIt3Wrapper to add icon files: #AutoIt3Wrapper_Res_File_Add=images\unix_vvw_icon.ico, RT_ICON, UNIX, 0 and this function to set the icon in the button when using compiled script: _Resource_SetToCtrlID(-1, 'UNIX', $RT_ICON) You need to put the attached file ResourcesEx.au3 in your AutoIT\include folder for this to work. A working version can be found in the EOR.zip filed joined as well. Enjoy Thanks, for the assist. Neutro I will look at the ResourcesEx.au3 more. Link to comment Share on other sites More sharing options...
Neutro Posted July 12, 2017 Share Posted July 12, 2017 (edited) You're welcome but dont bother with ResourcesEx for your script, i already fixed it Just download the EOR.zip file joined in my previous reply, put ResourcesEx.au3 in your AutoIT include folder, compile EOR2.au3 and it works Edited July 12, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! 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