My application listens for WM_QUERYENDSESSION messages for pop ups. I'm sure it was the shutdown message sent to the csrss.exe process that caused the immediate end popup.
My other idea is there any way to notify my application by other means when the power key is pressed? By setting the behavior of pressing the power button in the power option setting and listening to some other message.
How to prevent the end program pop-up window when shutting down
zehao chen
1
Reputation point
When the power off key is pressed, there is a program to prevent shutdown, by controlling the shutdown option in gpedit.msc, there are two different behaviors.
One is an immediate end pop-up window, One is that the shutdown interface appears and the shutdown application interface appears.
I want to close these two behaviors. Prevent pop ups or those two interfaces from appearing
My goal is that when I press the power button, the pop-up window of my application prompts the user whether to shut down, not affected by system behavior
What should I do? Thanks
1 answer
Sort by: Most helpful
-
zehao chen 1 Reputation point
2022-05-21T01:56:44.79+00:00