发送WM_SETTINGCHANGE,刷新系统环境变量
有时候在
系统中添加了一个
环境变量,却没有立即生效,又不想重启机器,可以采用如下API手动刷新环境变量:
//SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL);
PDWORD_PTR lpdwResult=0;
SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL,SMTO_ABORTIFHUNG,3,lpdwResult);
|
ref:
rary/ms725497(VS.85).aspx
阅读(2877) | 评论(0) | 转发(0) |