本文介绍了Windows屏幕保护程序和选项“关闭显示器"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经为OS Windows创建了屏幕保护程序",但是它忽略了选项关闭监视器"(显示属性->选项卡屏幕保护程序->电源"),并且无论如何仍在运行:confused:.

我的代码基于DirectX SDK示例.

我处理以下消息:

Hi,
I have created the "screen saver" for OS Windows, but it ignores option "turn off monitor" (Display properties -> tab Screen saver -> Power) and running anyway :confused: .

My code based on DirectX SDK example.

I process this messages:

case WM_ACTIVATEAPP:
    if( wParam == FALSE && m_SaverMode != sm_test )
        InterruptSaver();
    break;

case WM_POWERBROADCAST:
    if( wParam == PBT_APMSUSPEND && m_VerifySaverPassword == NULL )
        InterruptSaver();
    break;

case WM_SYSCOMMAND:
    if ( m_SaverMode == sm_full )
    {
        switch ( wParam )
        {
            case SC_NEXTWINDOW:
            case SC_PREVWINDOW:
            case SC_SCREENSAVE:
            case SC_CLOSE:
                return FALSE;
        };
    }
    break;



谢谢.



Thank you.

推荐答案

case WM_SYSCOMMAND:

switch ( wParam )
{
case SC_MONITORPOWER:
return DefWindowProc(hWnd, message, wParam, lParam);
//was: return 0;
};



这篇关于Windows屏幕保护程序和选项“关闭显示器"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 21:52