Windows-Toasts icon indicating copy to clipboard operation
Windows-Toasts copied to clipboard

New AUMID does not work

Open craterkamath opened this issue 2 years ago • 6 comments

I'm trying to create a simple python application that sends interactive toasts and minimizes into the system tray.

Whenever I use an existing AUMID from "Clock" or any other application that sends toasts it works without a problem.

When I try to register a new AUMID using the register_hkey_aumid.py or the register_hkey function, the toasts are not being sent. The toasts DO NOT work for the default command prompt AUMID too.

I do not see the new AUMID listed in the "Notifications & actions" as well. But I can see the registered key in the windows registry.

OS: Windows 11 Pro Version 22H2 Python Version: 3.11.5

craterkamath avatar Sep 01 '23 11:09 craterkamath

Have you got a reproducible code snippet? Also, what's the version of your windows-toasts?

DatGuy1 avatar Sep 01 '23 15:09 DatGuy1

Reproducable Code is here: https://github.com/craterkamath/aquaman/blob/master/aquaman/aquaman.py#L72 windows-toasts version: 1.0.0

craterkamath avatar Sep 01 '23 16:09 craterkamath

Odd, the snippet works for me. Sometimes when notifications get spammed, such as when debugging, Windows locks up the platform for an indeterminate amount of time. Have you tried restarting Windows?

You say 'Aquaman' doesn't show up in notifications & actions. Does it show up in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings? If there is an Enabled key try deleting it, or alternatively delete the Aquaman key entirely as well as HKCU\SOFTWARE\Classes\AppUserModelId\Aquaman.

If it still doesn't work try registering a different AUMID, such as Aquaman 2, and let me know if that works.

As an aside looking at your code, since the content of it is always static you should be able to define the toaster and toast outside of the function. At least the InteractableWindowsToaster should, as it makes a call into the Windows Runtime on initialisation. I'll add a note about it to the documentation.

DatGuy1 avatar Sep 01 '23 16:09 DatGuy1

Apologies for the delay in responding.

  1. Nope, does not work after restarting windows. I'm not quite sure what is & how the process is blocked from sending notifications but sadly restarting didn't do the trick.

  2. 'Aquaman' doesn't show up in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings as well. No record to edit. I tried deleting HKCU\SOFTWARE\Classes\AppUserModelId\Aquaman and restarting the process, the new key appears but the notification doesn't seem to work.

  3. Changing the key name did not work as well. Tried a couple of variety "AQMAN", "Aqua.man", "Aquaman2" just to see if there is not some undefined format.

  4. Thanks, I am working on optimizing it into a singleton that is shared across threads.

Any other settings/places that I can look at? I am very much surprised that it works on your device. Do I have to enable third-party notifications somewhere?

craterkamath avatar Sep 03 '23 03:09 craterkamath

@DatGuy1 I'm trying to zero-down on the component causing the trouble. Since you were able to make it work on your machine, I just wanted to ask how did you try out the code? Did you run the gui.py directly? or did you do a pip install to run Aquaman?

craterkamath avatar Sep 03 '23 16:09 craterkamath

@DatGuy1 I'm trying to zero-down on the component causing the trouble. Since you were able to make it work on your machine, I just wanted to ask how did you try out the code? Did you run the gui.py directly? or did you do a pip install to run Aquaman?

I copied aquaman.py and removed the threading bits to pretty much call L45-L60 in L81, and it just worked™. I believe this is may be an issue with some hidden setting on your system or such. What about running as administrator?

DatGuy1 avatar Sep 07 '23 10:09 DatGuy1