Closed Storik4pro closed 2 months ago
Since you just want to use a local image on your computer as an app icon, you can just register the app ID with Toast.register_app_id
normally. The snippet given in the example script is just a shortcut method to use a built-in Windows icon as an app icon. Otherwise, Toast.register_app_id
is the recommended way to register an app ID.
To register an app ID:
Toast.register_app_id("Lines.Storik4.goodbyedpiUI", "GoodbyeDPI UI", icon_uri = "C:/Users/serst/Pictures/asdasd.png")
Note that register_app_id
method doesn't require the URI scheme (so no file:///
must be used for this one), just the path of the image file where it is located on the computer.
Let me know if you need further help.
I changed the way I register the app, but the icon still doesn't appear in the notification.
def register_app():
Toast.unregister_app_id('Lines.Storik4.goodbyedpiUI')
Toast.register_app_id("Lines.Storik4.goodbyedpiUI", "GoodbyeDPI UI", icon_uri = "E:\ByeDPI\data\icon.png")
example_print_app_ids()
I also tried an existing control panel link as a link to the icon
def register_app():
Toast.unregister_app_id('Lines.Storik4.goodbyedpiUI')
Toast.register_app_id("Lines.Storik4.goodbyedpiUI", "GoodbyeDPI UI", icon_uri = "%SystemRoot%\ImmersiveControlPanel\images\logo.png")
example_print_app_ids()
But this had no effect. I also tried converting python script to exe, but it didn't help
I was able to fix the problem. In "app_id" you should specify the id without "."
Examples:
asyncio.run(show_message("Lines.Storik4.goodbyedpiUI", title, message))
asyncio.run(show_message("GoodbyeDPI_app", title, message))
In this case, both keys exist in the registry with the same values
App IDs are allowed to contain dots (.) so I don't think that was the problem. I guess it was caused by some sort of Windows caching (maybe a restart can resolve it?) or something else, I'm glad that you are able to resolve it, I will look further into the issue just in case.
Yes, rebooting solves the problem. I didn't think about it at all. Thank you! But, there is also an unpleasant problem that I encountered on another PC during testing. This is an error when writing the application to the registry
WinError 1021 "Cannot create a stable subkey under a volatile parent key."
can occur if there is already an application on the system that registers the AppUserModelId
as temporary. In my case it was Windows Explorer
I tried to manually create a partition but received the error "The partition cannot be created. There was an error writing to the registry"
The problem was solved by completely manually deleting the AppUserModelId
parameter and creating it again as a static parameter.
I don't know if this problem can be solved automatically, but I thought it was worth writing about it here
Oh, thanks, didn't knew volatile keys were a thing on Windows, that's new to me. It is strange though that Registry Editor doesn't indicate anything if a key or sub key is volatile.
Maybe I can check if I can make Toasted to create registry keys as volatile, so keys won't persist in the system. Also, I don't recommend completely deleting AppUserModelId
key and re-creating it since it may contain other app IDs which are used by other applications. You should only delete the subkey that Toasted has created. AppUserModelId
is assumed to be created by Windows.
Closing this issue since the app icon seems being set without an issue from Toasted-side, but I created #4 for setting keys as volatile.
I register the application through the example function and do not see the icon.
And app is registering But, i'm dont seen icon on nonflication What am I doing wrong?