禁止用户关闭操作系统

实现

private const int WM_QUERYENDSESSION=0x0011;

protected override void WndProc(ref Message m)  
{
    int i=0;
    switch(m.Msg)
    {
        case WM_QUERYENDSESSION:
            m.Result=(IntPtr)i;
            break;
        default:
            base.WndProc(ref m);
            break;
    }
}
Contributors: FHL