-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create a TrayIcon: TryCreate failed. #103
Comments
Unfortunately, this error simply indicates that the Windows API request failed and it does not provide any information about why this happened. |
That's a shame :( , but I don't know how to get a more detailed error log, I'm just an average and ignorant user of C#. |
The fact of the matter is that it doesn't exist. The lowest level does not provide any information. We can only try something and select the conditions for the error to occur, and try to understand the problem based on the conditions |
Some netizens returned to normal after executing the following script to clean thumbnails. The main ones should be the two lines in the registry. taskkill /f /im explorer.exe |
I personally tried to find this method is indeed feasible, after running the script has successfully solved the problem, thank you for your generous answer! |
Unfortunately, registry manipulation requires administrator rights, so this is not applicable in the library. I'll take a deeper look when I have some free time. |
I've faced this issue today while using From NotificationIcon Sample:
|
@HavenDV So maybe using the parameterless constructor of |
Yes, I use it also in TaskbarIcon class of main lib. |
WPF platform has similar issues,Occasionally occurs
|
Describe the bug
In Scighost/Starward using the H.NotifyIcon project, the TrayIcon cannot be generated.
Starward's author stated that the problem came from an internal error by H.NotifyIcon, leaving him unable to determine the specific cause.
Link here > Scighost/Starward#251
The log is as follows.
Steps to reproduce the bug
No response
Expected behavior
No response
Screenshots
[20:56:32.288] [EROR] Starward.Services.SystemTrayService
Initialize system tray
System.InvalidOperationException: TryCreate failed.
at H.NotifyIcon.Core.TrayIcon.Create() in //src/libs/H.NotifyIcon/Core/TrayIcon.cs:line 324
at H.NotifyIcon.TaskbarIcon.ForceCreate(Boolean ) in //src/libs/H.NotifyIcon.Shared/TaskbarIcon.cs:line 134
at Starward.Services.SystemTrayService.Initialize(GameBiz gameBiz) in D:\a\Starward\Starward\src\Starward\Services\SystemTrayService.cs:line 72
NuGet package version
No response
Platform
WinUI
IDE
Visual Studio 2022
Windows Version
Windows 10
WindowsAppSDK Version
1.1, Other
WindowsAppSDK Type
Packaged
Manifest
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: