ioa747 Posted December 8 Posted December 8 What I noticed is that if I run two or three scripts with _WinAPI_SetCurrentProcessExplicitAppUserModelID("My Custom GUI_v1.0") the icons are grouped in the taskbar while if I run them with _WinAPI_SetCurrentProcessExplicitAppUserModelID(StringTrimRight(@ScriptName, 3) & "_v1.0") each one has its own icon Thank you very much argumentum 1 I know that I know nothing
argumentum Posted December 8 Posted December 8 (edited) 11 minutes ago, ioa747 said: What I noticed is .. no, that would happen if using _WinAPI_SetCurrentProcessExplicitAppUserModelID(_WinAPI_CreateGUID()) because the identifier would be unique in each run I edited the example script to show that too. Thanks. Edited December 8 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ioa747 Posted December 8 Posted December 8 I made 4 scripts H1.au3, H2.au3 , H3.au3, H4.au3 all 4 with _WinAPI_SetCurrentProcessExplicitAppUserModelID(StringTrimRight(@ScriptName, 3) & "_v1.0") H1.au3, H2.au3 , H3.au3, H4.au3 all 4 with _WinAPI_SetCurrentProcessExplicitAppUserModelID("My Custom GUI_v1.0") I know that I know nothing
ioa747 Posted December 8 Posted December 8 in windows10 with @ScriptFullPath it doesn't work as expected argumentum 1 I know that I know nothing
argumentum Posted December 8 Posted December 8 27 minutes ago, ioa747 said: I made 4 scripts: H1.au3, H2.au3 , H3.au3, H4.au3 all 4 with obviously they are "H1_v1", "H2_v1", etc., because the ModelID string is different. I thought it was the same script run multiple times. 2 minutes ago, ioa747 said: in windows10 with @ScriptFullPath it doesn't work as expected Interesting. As far as I know, as long as the ModelID string is the same, ... that's that. It should be the same. Win 10 or 11. Tho I never tested how long the string can be ( https://github.com/dotnet/maui/issues/20031 ) ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ioa747 Posted December 8 Posted December 8 you are absolutely right, I copied it from D:\i\Pro\.AutoIT\_Test\000_forum-topic\209641-No-custom-GUI-icon-in-taskbar-when-au3-script-is-executed-by-Run-script-option\1539207-argumentum.au3 to D:\tmp\1539207-argumentum.au3 and it works thanks I know that I know nothing
argumentum Posted December 8 Posted December 8 I'd like to have "_WinAPI_GetCurrentProcessExplicitAppUserModelID()" but don't know how 😭 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ioa747 Posted December 8 Posted December 8 (edited) https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_GetCurrentProcessExplicitAppUserModelID.htm #NoTrayIcon #include <GUIConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPIProc.au3> ;~ _WinAPI_SetCurrentProcessExplicitAppUserModelID(_WinAPI_CreateGUID()) _WinAPI_SetCurrentProcessExplicitAppUserModelID(StringTrimRight(@ScriptName, 3) & "_v1.0") ;~ _WinAPI_SetCurrentProcessExplicitAppUserModelID("My Custom GUI_v1.0") GUICreate("My Custom GUI", 300, 200, @DesktopWidth * 0.2, @DesktopHeight * 0.6) GUISetIcon(@ScriptDir & '\iH1.ico') ; ok TraySetIcon(@ScriptDir & '\iH1.ico') ; ok GUISetState(@SW_SHOW) Local $sAppID = _WinAPI_GetCurrentProcessExplicitAppUserModelID() If @error Then MsgBox($MB_ICONERROR, "Error", "Failed to retrieve AppUserModelID. Error code: " & @extended) Else MsgBox($MB_ICONINFORMATION, "AppUserModelID", "The current process AppUserModelID is: " & $sAppID) EndIf Do Until GUIGetMsg() = -3 ; $GUI_EVENT_CLOSE (-3) Edited December 8 by ioa747 argumentum 1 I know that I know nothing
argumentum Posted December 8 Posted December 8 (edited) 22 minutes ago, ioa747 said: you are absolutely right, I figured after you posted that the length would be limited. Found that the max length is 128 So bad idea on my part. but could use a hash of the @ScriptFullPath to make it unique for the path 🤔 Edited December 8 by argumentum oops ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
argumentum Posted December 8 Posted December 8 (edited) 29 minutes ago, ioa747 said: https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_GetCurrentProcessExplicitAppUserModelID.htm then the max length is 127. Because after that it returns an error and an empty string Edit: I added these findings to the example. Edited December 8 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ioa747 Posted December 8 Posted December 8 (edited) then it's better with StringTrimRight(@ScriptName, 4) to eat the dot too "MyScript_v1.0" in stat "MyScript._v1.0" Edited December 8 by ioa747 I know that I know nothing
argumentum Posted December 8 Posted December 8 ...food for thought. The idea was to showcase the function clearly. That's there. How to implement it, is up to the coder given the many ways that could be used based on a given project. The examples are there. The coder would decide how to implement it I guess. 🤷♂️ ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
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