Zedna Posted February 8, 2023 Share Posted February 8, 2023 (edited) According to this my old post with similar problem: different title on taskbar/gui here is modification for different icon on taskbar/gui -> which works for me in all situations (Drag/Run/Scite...): expandcollapse popup#NoTrayIcon #include <GUIConstants.au3> #include <Misc.au3> #include <SendMessage.au3> ;~ Global Const $WM_SYSCOMMAND = 0x0112 ;~ Global Const $SC_MINIMIZE = 0xF020 ;~ Global Const $SC_RESTORE = 0xF120 ;~ Global Const $WM_MOVE = 0x3 ;~ Global Const $WM_SIZE = 0x05 $app = GUICreate("Application title", 1, 1,-1,-1,$WS_POPUP) GUISetIcon(@ScriptDir & '\test1.ico') GUISetState(@SW_SHOW, $app) $gui = GUICreate("Form title", 300, 200, -1, -1, -1, -1, $app) GUISetIcon(@ScriptDir & '\test2.ico') GUISetState(@SW_SHOW, $gui) GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") GUIRegisterMsg($WM_MOVE, "WM_MOVE") Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam) Switch $wParam Case $SC_MINIMIZE _SendMessage($app, $WM_SYSCOMMAND, $SC_MINIMIZE, 0) GUISetState(@SW_HIDE, $gui) Return 0 Case $SC_RESTORE _SendMessage($app, $WM_SYSCOMMAND, $SC_RESTORE, 0) GUISetState(@SW_SHOW, $gui) Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc Func WM_MOVE($hWnd, $Msg, $wParam, $lParam) ;~ If $hWnd = $gui Then $pos = WinGetPos($gui) WinMove($app, '', $pos[0], $pos[1]) ;~ WinMove($app, '', _LoWord($wParam), _HiWord($wParam)) ;~ EndIf Return $GUI_RUNDEFMSG EndFunc Func _HiWord($x) Return BitShift($x, 16) EndFunc Func _LoWord($x) Return BitAND($x, 0xFFFF) EndFunc Edited February 8, 2023 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ioa747 Posted February 8, 2023 Share Posted February 8, 2023 unfortunately it doesn't work I know that I know nothing Link to comment Share on other sites More sharing options...
Zedna Posted February 8, 2023 Share Posted February 8, 2023 (edited) Here is simplified version, which should work also on new AutoIt's versions (I use very old 3.2.12.1): #NoTrayIcon #include <GUIConstantsEx.au3> $app = GUICreate("Application title", 1, 1,-1,-1,0x80000000) ; $WS_POPUP=0x80000000 GUISetIcon(@ScriptDir & '\test1.ico') GUISetState(@SW_SHOW, $app) $gui = GUICreate("Form title", 300, 200, -1, -1, -1, -1, $app) GUISetIcon(@ScriptDir & '\test2.ico') GUISetState(@SW_SHOW, $gui) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE But this works for me also when running on my (Unzipped) AutoIt 3.3.14.5/3.3.16.1 ... Edited February 8, 2023 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ioa747 Posted February 8, 2023 Share Posted February 8, 2023 (edited) not working how do you have it installed? is portable? is in C:\Program Files (x86)\ ? why is possible by drop in folder out of C:\Program Files (x86)\ ? Edited February 8, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted February 8, 2023 Share Posted February 8, 2023 (edited) yesterday i installed it on c:\ , without result, and I reinstalled it on C:\Program Files (x86)\ Edited February 8, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
Nine Posted February 8, 2023 Share Posted February 8, 2023 not working for me either -- @Zedna you have a magical installation “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 8, 2023 Share Posted February 8, 2023 @Nine can you enlighten us ? I have this version v3.3.16.1 19 September, 2022https://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.zip if i run the script from shell with right click custom icon in taskbar not working if i run the script from SciTE with f5 custom icon in taskbar not working if i drop the script on C:\Program Files (x86)\AutoIt3\AutoIt3.exe custom icon in taskbar not working if I copy the AutoIt3 folder from C:\Program Files (x86)\AutoIt3 to C:\ , and drop the script on AutoIt3.exe custom icon in taskbar is working Is there a logical explanation? I know that I know nothing Link to comment Share on other sites More sharing options...
Zedna Posted February 8, 2023 Share Posted February 8, 2023 (edited) I have got standard instalation by installer 3.2.12.1 + full Scite4AutoIt3 (from that old time). Newer versions on my computer are only unzipped AutoIt+Scite4AutoIt3. On my machine it's OK with ALL versions in all scenarios. I still don't know why it's OK on my machine and not on yours. EDIT: I have (completely) disabled UAC on all my computers, maybe try to disable it (temporarily) too ... Edited February 8, 2023 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Nine Posted February 8, 2023 Share Posted February 8, 2023 Which version of OS do you have @Zedna ? I have totally no idea why it is working for Zedna and not for us all “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...
Zedna Posted February 8, 2023 Share Posted February 8, 2023 Tested on Win10 (at work) and Win7 (at home). Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Nine Posted February 8, 2023 Share Posted February 8, 2023 Well, I have both too. And none is working correctly as you. In fact, you are the only one that works. So what does it tell you ? You are an MVP, question and answer is on your side to understand and tell us the reason. “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...
TimRude Posted February 16, 2023 Share Posted February 16, 2023 (edited) On my Windows 10 system with AutoIt 3.3.16.1 installed, if I have the system taskbar setting 'Combine taskbar buttons' set to 'Always, hide labels', I get the generic AutoIt icon in the taskbar when running an uncompiled script. But if I change that setting to 'Never' or 'When taskbar is full', I see the custom icon. Edited February 16, 2023 by TimRude ioa747 and Zedna 2 Link to comment Share on other sites More sharing options...
ioa747 Posted February 16, 2023 Share Posted February 16, 2023 that is something. But what cracks me up is if I copy the AutoIt3 folder from C:\Program Files (x86)\AutoIt3 to C:\ , and drop the script on AutoIt3.exe custom icon in taskbar is working Is there a logical explanation? I have come to the conclusion that something is going on in the windows registry, but I don't know what I know that I know nothing Link to comment Share on other sites More sharing options...
Solution argumentum Posted February 16, 2023 Solution Share Posted February 16, 2023 _WinAPI_SetCurrentProcessExplicitAppUserModelID() will fix that maniootek, ioa747, TimRude and 1 other 4 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
TimRude Posted February 16, 2023 Share Posted February 16, 2023 (edited) 24 minutes ago, argumentum said: _WinAPI_SetCurrentProcessExplicitAppUserModelID() will fix that Yep, it sure does! Now I get the custom icon in the taskbar no matter what 'Combine taskbar buttons' setting I use. #NoTrayIcon #include <GUIConstants.au3> #include <WinAPICom.au3> #include <WinAPIShellEx.au3> _WinAPI_SetCurrentProcessExplicitAppUserModelID(_WinAPI_CreateGUID()) ; ensure a unique ID GUICreate("My Custom GUI", 300, 200) GUISetIcon(@SystemDir & "\shell32.dll", 239) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited February 16, 2023 by TimRude 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