如何继续执行系统关机事件呢?
我在程序中写了如下代码:
protected override void WndProc(ref Message m)
{
   int WM_ENDSESSION = 0x0016;
   if (m.Msg == WM_ENDSESSION)
  {
     if (MessageBox.Show("关闭xxx程序?", "xxx管理程序", MessageBoxButtons.OKCancel,                                                MessageBoxIcon.Exclamation) == DialogResult.Cancel)
           return;
     else
    { 
       m.WParam = (IntPtr)0;
       m.Result = (IntPtr)1;
       this.Close();
    }
  }
  base.WndProc(ref m);
}
当关机时系统弹出了提示,我点击确定后,程序是关闭了,但系统不继续关闭,要再执行一下关机才行,这是怎么回事?我怎么做才能继续关机?
谢谢!