SPI_SETDISABLEOVERLAPPEDCONTENT后如何刷新?
然而,当使用“轻松访问中心”中的“删除背景图像”复选框正确设置SPI_SETDISABLEOVERLAPPEDCONTENT
时
User32.SystemParametersInfo(SPI_SETDISABLEOVERLAPPEDCONTENT, 0, true, User32.SPIF_UPDATEINIFILE)
,它没有任何效果。只有在轻松访问中心单击“确定”后,设置才会正确激活并删除背景图像。有没有办法以编程方式强制刷新?对于 SystemParametersInfo() 的许多其他设置,常量 SPIF_UPDATEINIFILE 就足够了,但在本例中不行。
When setting the SPI_SETDISABLEOVERLAPPEDCONTENT
using
User32.SystemParametersInfo(SPI_SETDISABLEOVERLAPPEDCONTENT, 0, true, User32.SPIF_UPDATEINIFILE)
the checkbox "Remove background images" in the "Ease of Access Center" is set correctly, however, it does not have any effect. Only after clicking "OK" in the Ease of Access Center the setting is properly activated and the background image is removed. Is there a way to force the refresh programmatically? For many other settings of SystemParametersInfo()
the constant SPIF_UPDATEINIFILE
is enough but not in this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能还需要 SPIF_SENDCHANGE: _UPDATEINIFILE 确保该值保存到注册表(或其他适当的位置),以便它在未来的会话中生效,但它会默默地保存,而不通知任何当前正在运行的应用程序 - 所以它们只有重新启动时才会注意到。使用 _SENDCHANGE 会导致 API 向所有顶级窗口发送 WM_SETTINGSCHANGE 消息,通知它们某些内容已发生更改;编写良好的应用程序将在此时重新读取 API 或注册表中的设置并更新/重新绘制。轻松访问控制面板很可能使用这两个标志。
You'll likely need SPIF_SENDCHANGE also: _UPDATEINIFILE ensures that the value gets saved to the registry (or wherever else appropriately) so that it takes effect on future sessions, but it does this save silently, without notifying any currently-running applications - so they'll notice only when restarted. Using _SENDCHANGE causes the API to send a WM_SETTINGSCHANGE message to all top-level windows, notifying them that something has changed; well-written apps will re-read the settings from the API or registry at that point and update/repaint. The Ease Of Access control panel is very likely using both flags.