既然改了注册表,就让window知道注册表改啦!
SystemParametersInfo里有个参数是通知系统注册表更改的!
fWinIni
If a system parameter is being set, specifies whether the user profile is to be updated, and if so,
whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change.
This parameter can be zero or can be one of the following values:
Value Action
SPIF_UPDATEINIFILE Writes the new system-wide parameter setting to the user profile.
SPIF_SENDCHANGE Broadcasts the WM_SETTINGCHANGE message after updating the user profile.
SPIF_SENDWININICHANGE Same as SPIF_SENDCHANGE.
一般来说,你需要在修改注册表后广播发送WM_SETTINGCHANGE消息(在Windows NT下为WM_WININICHANGE消息)。
如果使用SystemParametersInfo修改系统设置,最后一个参数应设置为SPIF_SENDWININICHANGE。
这样,有关程序接收到该消息采取相应的操作