使用VC里修改注册表的API修改了:
HKEY_CURRENT_USER\Environment\Path
HEKY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment\Path
//////////////////////////
加上这几句
Dword dwResult=0;
PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE , NULL, NULL);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE , NULL,
(LPARAM)"Environment",SMTO_NORMAL, 1000, &dwResult);
SendMessageTimeout(HWND_BROADCAST,
WM_SETTINGCHANGE , NULL, (LPARAM)"Environment", SMTO_NOTIMEOUTIFNOTHUNG,1000, &dwResult);
/////////////
::SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,(LPARAM)TEXT("Environment"));
加上这句就行了。
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。