原文地址:Shell_NotifyIconA function (shellapi.h) - Win32 apps | Microsoft Learn
Shell_NotifyIcon will often fail when called during Windows startup (for instance, if your application is listed in HKLM\Software\Microsoft\Windows\CurrentVersion\Run. This appears to be because the system is busy starting applications. The failure is more common on low-spec computers or computers with some brands of antivirus software installed, which seem to be very intensive at startup.
Unfortunately, you cannot rely on the error code returned by GetLastError. When Shell_NotifyIcon return