VC++ 6.0 MFC - Temp disable mouse and keyboard for 5 secs.
-
I'm developing an app that needs to shut off the monitor after a given time, much like a screensaver. I've done some googling but cannot seem to find anything that works or is relevant. My example function: void CMyAppDlg::OnTimer(UINT nIDEvent) { //Turn off monitor / standby - (depends on monitor) //my lcd only goes to "sleep". SendMessage(WM_SYSCOMMAND, SC_MONITORPOWER, 2); //<- this works, but is aborted ad soon as user move mouse or keys... //Here is where I need to "freeze" mouse and keybrd. //for 5 sec. or so, to prevent user from activating / wake up the //monitor again aborting the shutoff-command, so they realize it's shut //off. CDialog::OnTimer(nIDEvent); } Thanx! (VC++ 6.0 MFC, Win-XP)
-
I'm developing an app that needs to shut off the monitor after a given time, much like a screensaver. I've done some googling but cannot seem to find anything that works or is relevant. My example function: void CMyAppDlg::OnTimer(UINT nIDEvent) { //Turn off monitor / standby - (depends on monitor) //my lcd only goes to "sleep". SendMessage(WM_SYSCOMMAND, SC_MONITORPOWER, 2); //<- this works, but is aborted ad soon as user move mouse or keys... //Here is where I need to "freeze" mouse and keybrd. //for 5 sec. or so, to prevent user from activating / wake up the //monitor again aborting the shutoff-command, so they realize it's shut //off. CDialog::OnTimer(nIDEvent); } Thanx! (VC++ 6.0 MFC, Win-XP)
#include // For Visual Studio 6.0
:
BlockInput( true );
Sleep( 5000 );
BlockInput( false );Is this of any use for you??Please include the proper header
-
#include // For Visual Studio 6.0
:
BlockInput( true );
Sleep( 5000 );
BlockInput( false );Is this of any use for you??Please include the proper header
Thanks BlockInput() was what I was looking for. :)