Windows 7 Display on/off event issue?
Posted: Fri Jul 31, 2015 2:13 pm
Hi,
I'm trying to capture display on/off event using following code, able to capture off event but not on.
I'm not understanding where its going wrong. Help me to solve this issue.
Regards,
Rajan.M
I'm trying to capture display on/off event using following code, able to capture off event but not on.
Code: Select all
WXLRESULT MyFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
wxTextCtrl* textctrl = (wxTextCtrl*)FindWindowById(MOUSE_TEXT,this);
if(nMsg == WM_SYSCOMMAND )
{
if(wParam == SC_MONITORPOWER)
{
if(lParam == -1)
textctrl->AppendText("monitor on\n"); //not working
if(lParam == 2)
textctrl->AppendText("monitor off")); //working
}
}
}
Regards,
Rajan.M