OhBobSaget Posted April 14, 2021 Share Posted April 14, 2021 Hi, I am wondering if it is possible to store and access different icon ressource in the AutoIT Exe. I know that i can make that my app as an icon with : #AutoIt3Wrapper_icon=Icon.ico But i would like to have the possibility to change the tray icon depending on the status of the running app... I know i could simply do it by accessing an external image/icon file, but i would like to use embedded ressources within the EXE if possible. Thank you for your help Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 14, 2021 Moderators Share Posted April 14, 2021 (edited) Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Edited April 14, 2021 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
OhBobSaget Posted April 14, 2021 Author Share Posted April 14, 2021 Can i move it or delete it ? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 14, 2021 Developers Share Posted April 14, 2021 It is already moved as the standard message indicates. OhBobSaget 1 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...
Moderators Melba23 Posted April 14, 2021 Moderators Share Posted April 14, 2021 (edited) OhBobSaget, For one of my apps I add the icons to the executable like this: #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_0.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_1.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_2.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_3.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_4.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_5.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_6.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play_7.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_0.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_1.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_2.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_3.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_4.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_5.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_6.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause_7.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Index.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_File.ico #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_List.ico And then assign their indices like this: Global Const $iPlay_Icon = -5, $iPause_Icon = -13, $iIndex_Icon = -21, $iFile_Icon = -22, $iList_Icon = -23 Which allows me use lines like this within the code: TraySetIcon(@ScriptFullPath, $iPause_Icon - $iIcon_Progress) TraySetIcon(@ScriptFullPath, $iIndex_Icon) TraySetIcon(@ScriptFullPath, $iFile_Icon) I hope that helps. M23 Edit: Sorry, the syntax for the directive has changed since I wrote and compiled that. The current version reads: #AutoIt3Wrapper_Res_Icon_Add= ; Filename[,ResNumber[,LanguageCode]] of ICO to be added. ; Add extra ICO files to the resources ; Use full path of the ico files to be added ; ResNumber is a numeric value used to access the icon: TraySetIcon(@ScriptFullPath, ResNumber) ; If no ResNumber is specified, the added icons are numbered from 201 up So you will need to adjust the assignment statements to match. Edited April 14, 2021 by Melba23 FrancescoDiMuro and OhBobSaget 2 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...
OhBobSaget Posted April 15, 2021 Author Share Posted April 15, 2021 So if i understand correctly : #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Play.ico,1 #AutoIt3Wrapper_Res_Icon_Add=M:\Program\Au3 Scripts\BMP\Icons\BMP_Pause.ico,2 Then... Global Const $iPlay_Icon =1, $iPause_Icon =2 Then TraySetIcon(...) Is that correct ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 15, 2021 Moderators Share Posted April 15, 2021 OhBobSaget, Close - the icons will be 201 & 202 as explained in the Help file snippet I posted. M23 OhBobSaget 1 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...
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