Creating a simple application, so when a user logs out of Windows, he, of course, disables the application. We are making a simple USB Alert application that shuts down when USB is detected when the user logs out.
This is the code so far.
public Form1() { InitializeComponent(); } private static int WM_QUERYENDSESSION = 0x11; private static bool systemShutdown = false; protected override void WndProc(ref System.Windows.Forms.Message m) { if (m.Msg == WM_QUERYENDSESSION) {
What happens when the Windows enforcement programs screen for closing is displayed, I read somewhere, if you return 0 to WM_QUERYENDSESSION, it does not display this, but it still displays this ...
Any ideas?
EDIT:
We used the code that someone answered, but we still get this screen.

x06265616e
source share