开发者

How to refresh after SPI_SETDISABLEOVERLAPPEDCONTENT?

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 activate开发者_Python百科d 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜