maniootek Posted February 7, 2023 Share Posted February 7, 2023 My Autoit script contains code which show GUI with custom icon (GuiSetIcon() function is used). When I compile my script to exe and run it then I can see my custom icon on the windows taskbar but when I run my script with option "Run script" then I see default AutoIt icon on the taskbar. I want see my custom icon on the taskbar when I run my script with option "Run script" or I when I use code: Run("C:\Program Files (x86)\AutoIt3\Autoit3.exe" "C:\myscript.au3") Any idea? Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 (edited) where is your script ? or take a look https://www.autoitscript.com/autoit3/docs/functions/TraySetIcon.htm and here https://www.autoitscript.com/wiki/AutoIt3Wrapper_Directives#List_of_AutoIt3Wrapper_Directives Edited February 7, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
Nine Posted February 7, 2023 Share Posted February 7, 2023 You will need to make a copy of AutoIt3.exe into a new directory, hack its icon to change it to yours, then run with this new exe. Voilà ! Or you can just compile it maniootek 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 but he says 2 hours ago, maniootek said: When I compile my script to exe and run it then I can see my custom icon on the windows taskbar I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 @maniootek try compile this script #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=C:\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Red.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> Example() Func Example() GUICreate("My GUI new icon") ; will create a dialog box that when displayed is centered $sFile = "C:\Program Files (x86)\AutoIt3\Icons\MyAutoIt3_Red.ico" GUISetIcon($sFile) ; will change icon GUISetState(@SW_SHOW); will display an empty dialog box ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example I know that I know nothing Link to comment Share on other sites More sharing options...
Nine Posted February 7, 2023 Share Posted February 7, 2023 (edited) @ioa747 I know I was just underlining this fact ps. OP does not want to compile his script ! Edited February 7, 2023 by Nine ioa747 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 I probably want new glasses I know that I know nothing Link to comment Share on other sites More sharing options...
Zedna Posted February 7, 2023 Share Posted February 7, 2023 This works for me compiled/uncompiled: ;#NoTrayIcon #include <GUIConstantsEx.au3> GUICreate("Test", 300, 200) GUISetIcon(@ScriptDir & '\test.ico') TraySetIcon(@ScriptDir & '\test.ico') GUISetState(@SW_SHOW) While 1 If GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Anyway try this if you use embeded icon added at compile time by #AutoIt3Wrapper: #AutoIt3Wrapper_icon=test.ico ;#NoTrayIcon #include <GUIConstantsEx.au3> GUICreate("Test2", 300, 200) If Not @Compiled Then GUISetIcon(@ScriptDir & '\test.ico') TraySetIcon(@ScriptDir & '\test.ico') EndIf GUISetState(@SW_SHOW) While 1 If GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
maniootek Posted February 7, 2023 Author Share Posted February 7, 2023 (edited) Tray icon and gui icon is no problem, it works, It's all about Windows 10 taskbar icon when script is run as a parameter of autoit.exe (run script option) Your code also show autoit icon (not custom icon). Edited February 7, 2023 by maniootek Link to comment Share on other sites More sharing options...
Zedna Posted February 7, 2023 Share Posted February 7, 2023 On my Win10 i see all 3 icons (gui+taskbar+tray) OK -> my custom icon, also when running uncompiled and started by "Run script" context menu from system. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 just i test in win 10 no custom icon in taskbar with v3.3.16.1 but with autoit-v3.3.14.5 is possible I know that I know nothing Link to comment Share on other sites More sharing options...
maniootek Posted February 7, 2023 Author Share Posted February 7, 2023 (edited) My AutoIt version 3.3.14.5 and it's not working I remember it used to work before Edit: I just installed 3.3.16.1 and it's still not working. Edited February 7, 2023 by maniootek Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 (edited) download this https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.14.1.zip unzip , don't install , just drop your @Zedna script on AutoIt3.exe Working? Edited February 7, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 in https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.16.0.zip working also I know that I know nothing Link to comment Share on other sites More sharing options...
maniootek Posted February 7, 2023 Author Share Posted February 7, 2023 23 minutes ago, ioa747 said: download this https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.14.1.zip unzip , don't install , just drop your @Zedna script on AutoIt3.exe Working? this version working! Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 (edited) 11 minutes ago, ioa747 said: in https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.16.0.zip working also she is also younger Edited February 7, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 this work also https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.16.1.zip ??? I know that I know nothing Link to comment Share on other sites More sharing options...
maniootek Posted February 7, 2023 Author Share Posted February 7, 2023 This is not that easy as it seems to be. It is working when I move the au3 file into AutoIt.exe file but when I use "Run script" option from context menu it doesn't (even if I use same AutoIt version). Please check movie: Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 (edited) i check it out... ...and nothing. You have right. This is possible only by drop Edited February 7, 2023 by ioa747 i check it out... I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted February 7, 2023 Share Posted February 7, 2023 @Zedna can you enlighten us why this is happening? do you have other version? how do you have it installed? I know that I know nothing 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