Windows处理系统睡眠唤醒消息

MFC(C++):

LRESULT CWifiShareToolDlg::WindowProc(UINT message, WPARAM wParam, LPARAM IParam)
{
	if ((message == WM_POWERBROADCAST) && (wParam == PBT_APMRESUMEAUTOMATIC)) {

	}

	return CDialog::WindowProc( message, wParam, IParam);
}

C#:

protected override void WndProc(ref Message m)
 {

            int WM_POWERBROADCAST = 0x0218;
            int PBT_APMRESUMEAUTOMATIC = 0x0012;

            if ((m.Msg == WM_POWERBROADCAST) && (m.WParam.ToInt32() == PBT_APMRESUMEAUTOMATIC)) {

            }
            base.WndProc(ref m);
 }

 

你可能感兴趣的:(Windows开发)