[ad_1]
Is there a way to prevent shutdown or restarting on Windows using WM_QUERYENDSESSION
or WM_ENDSESSION
messages from the Windows API? I tried to make it by returning FALSE
to the message but it doesn’t do anything. I don’t know much about receiving messages and doing things with them so any help is appreciated.
#include <Windows.h>
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_QUERYENDSESSION)
{
return FALSE;
}
}
int main()
{
WindowProc;
}
[ad_2]