如何刷新登录屏保参数更改? [英] How to refresh logon screensaver parameter changes?

查看:33
本文介绍了如何刷新登录屏保参数更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Windows 服务,它可能会更改 Windows 中登录屏幕保护程序的超时时间(如 此处所述.) 为此,我将以下注册表项更改为以秒为单位的超时时间:

I have a Windows service that may change the timeout on the logon screensaver in Windows (as described here.) To do that I change the following registry key to the timeout in seconds:

HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut

问题是如何让操作系统读取"或刷新在上面的注册表项更改后实际屏幕保护程序超时?

The issue is that how do I make OS "read" or refresh the actual screensaver timeout after a change in the registry key above?

我的实践表明,只有在我重新启动系统时才会刷新它(当然),但在我的情况下,我需要在不重新启动的情况下应用它.

My practice shows that it is refreshed (for sure) only when I reboot the system, but in my case I need it to be applied without the reboot.

EDIT_1:根据下面的建议,在我看来,我尝试了以下所有可能的标志组合:

EDIT_1: After suggestion below I tried, as it seems to me, all possible combinations of the flags for the following:

DWORD bsmInfo1 = BSM_ALLDESKTOPS;
DWORD dwFlgs = BSF_FORCEIFHUNG | BSF_IGNORECURRENTTASK | BSF_NOTIMEOUTIFNOTHUNG | BSF_SENDNOTIFYMESSAGE;
int nbsm1 = ::BroadcastSystemMessage(dwFlgs, &bsmInfo1, WM_SETTINGCHANGE, 0, (LPARAM)L"Windows");
DWORD bsmInfo2 = BSM_ALLDESKTOPS;
int nbsm2 = ::BroadcastSystemMessage(dwFlgs, &bsmInfo2, WM_SETTINGCHANGE, 0, (LPARAM)L"WindowsThemeElement");

无济于事:(我从两个电话中都收到了 1,但没有任何效果.

to no avail :( I receive 1 as a result from both calls but it has no effect.

推荐答案

我能够解决这个问题.-.-.

这篇关于如何刷新登录屏保参数更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆