Я пытаюсь обнаружить Windows LogOff или завершение работы в моем приложении WPF.Может кто-нибудь помочь?
xaml.cs
private static int WM_QUERYENDSESSION = 0x11;
private static bool systemShutdown = false;
public static event Microsoft.Win32.SessionEndingEventHandler SessionEnding;
protected virtual void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == WM_QUERYENDSESSION)
{
MessageBox.Show("queryendsession: this is a logoff, shutdown, or reboot");
systemShutdown = true;
}
// If this is WM_QUERYENDSESSION, the closing event should be
// raised in the base WndProc.
base.WndProc(ref m); //Error
} //WndProc
Ошибка: RadWindow не содержит определения для 'WndProc'