After the wpf program starts, there is no interface and no icon.

I need to capture the startup and shutdown messages of windows, so I need an interface. After I do boot, the program does call my method in the background, but there is no interface, so I cannot receive the shutdown message of windows. But if I open the program normally and then shut down, it will work normally, and an icon will appear in the taskbar.
ask for divine support.


whether there is a interface has nothing to do with whether you can accept windows messages or not.
in addition, to describe the problem in more detail, very few people in this community ask .net


to open the task manager, find the process, and see if the session ID is 0?

Menu