VC 重新整理桌面圖示和工作列圖示
阿新 • • 發佈:2019-02-12
重新整理工作列圖示:
- SHChangeNotify(SHCNE_ASSOCCHANGED ,SHCNF_IDLIST ,NULL, NULL);
重新整理桌面圖示:
- int nSize = GetSystemMetrics(SM_CXICON);
- HKEY hKey;
- RegOpenKeyEx(HKEY_CURRENT_USER, L"Control Panel\\Desktop\\WindowMetrics", 0, KEY_ALL_ACCESS, &hKey);
- wchar_t szBuff[20];
-
swprintf(szBuff, L"%d"
- RegSetValueEx(hKey, L"Shell Icon Size", 0, REG_SZ, (unsigned char*)szBuff, wcslen(szBuff)*2);
- SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0);
- swprintf(szBuff, L"%d", nSize);
-
RegSetValueEx(hKey, L"Shell Icon Size", 0, REG_SZ,(unsigned char*)szBuff, wcslen(szBuff)*2);
- SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0, 0);
XP\WIN7測試可行。
http://blog.csdn.net/mfcing/article/details/50345193