diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2008-10-03 07:25:33 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2008-10-03 07:25:33 +0400 |
commit | fd3dfe206a7a37c41a95f845e2b717b2f15d3ecb (patch) | |
tree | b16d801917b891a025487629a0da8de8524436f9 /src/apps/mplayerc/PPageFormats.cpp | |
parent | a134935b5f8ddb5c7e8bb84ead882a6e2814d9fe (diff) |
CHANGE : RebuildIconsCache(rev.815) replace with SHChangeNotify() - to correct and complete repaint icons, since the association
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@816 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PPageFormats.cpp')
-rw-r--r-- | src/apps/mplayerc/PPageFormats.cpp | 85 |
1 files changed, 1 insertions, 84 deletions
diff --git a/src/apps/mplayerc/PPageFormats.cpp b/src/apps/mplayerc/PPageFormats.cpp index 88583d36c..756fbc401 100644 --- a/src/apps/mplayerc/PPageFormats.cpp +++ b/src/apps/mplayerc/PPageFormats.cpp @@ -297,89 +297,6 @@ bool CPPageFormats::RegisterExt(CString ext, CString strProgID, CString strLabel return(true);
}
-void CPPageFormats::RebuildIconsCache() // source get from TSVN Windows client ...
-{
- const int BUFFER_SIZE = 1024;
- TCHAR *buf = NULL;
- HKEY hRegKey = 0;
- DWORD dwRegValue;
- DWORD dwRegValueTemp;
- DWORD dwSize;
- DWORD_PTR dwResult;
- LONG lRegResult;
- std::wstring sRegValueName;
- std::wstring sDefaultIconSize;
- int iDefaultIconSize;
- bool bResult = false;
-
- lRegResult = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Control Panel\\Desktop\\WindowMetrics"),
- 0, KEY_READ | KEY_WRITE, &hRegKey);
- if (lRegResult != ERROR_SUCCESS)
- goto Cleanup;
-
- buf = new TCHAR[BUFFER_SIZE];
- if(buf == NULL)
- goto Cleanup;
-
- // we're going to change the Shell Icon Size value
- sRegValueName = _T("Shell Icon Size");
-
- // Read registry value
- dwSize = BUFFER_SIZE;
- lRegResult = RegQueryValueEx(hRegKey, sRegValueName.c_str(), NULL, NULL,
- (LPBYTE) buf, &dwSize);
- if (lRegResult != ERROR_FILE_NOT_FOUND)
- {
- // If registry key doesn't exist create it using system current setting
- iDefaultIconSize = ::GetSystemMetrics(SM_CXICON);
- if (0 == iDefaultIconSize)
- iDefaultIconSize = 32;
- _sntprintf_s(buf, BUFFER_SIZE, BUFFER_SIZE, _T("%d"), iDefaultIconSize);
- }
- else if (lRegResult != ERROR_SUCCESS)
- goto Cleanup;
-
- // Change registry value
- dwRegValue = _ttoi(buf);
- dwRegValueTemp = dwRegValue-1;
-
- dwSize = _sntprintf_s(buf, BUFFER_SIZE, BUFFER_SIZE, _T("%d"), dwRegValueTemp) + sizeof(TCHAR);
- lRegResult = RegSetValueEx(hRegKey, sRegValueName.c_str(), 0, REG_SZ,
- (LPBYTE) buf, dwSize);
- if (lRegResult != ERROR_SUCCESS)
- goto Cleanup;
-
-
- // Update all windows
- SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS,
- 0, SMTO_ABORTIFHUNG, 5000, &dwResult);
-
- // Reset registry value
- dwSize = _sntprintf_s(buf, BUFFER_SIZE, BUFFER_SIZE, _T("%d"), dwRegValue) + sizeof(TCHAR);
- lRegResult = RegSetValueEx(hRegKey, sRegValueName.c_str(), 0, REG_SZ,
- (LPBYTE) buf, dwSize);
- if(lRegResult != ERROR_SUCCESS)
- goto Cleanup;
-
- // Update all windows
- SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETNONCLIENTMETRICS,
- 0, SMTO_ABORTIFHUNG, 5000, &dwResult);
-
- bResult = true;
-
-Cleanup:
- if (hRegKey != 0)
- {
- RegCloseKey(hRegKey);
- }
- if (buf != NULL)
- {
- delete buf;
- }
-
- //return bResult;
-}
-
static struct {LPCSTR verb, cmd; UINT action;} handlers[] =
{
{"VideoFiles", " %1", IDS_AUTOPLAY_PLAYVIDEO},
@@ -846,7 +763,7 @@ BOOL CPPageFormats::OnApply() AppSettings& s = AfxGetAppSettings();
s.Formats.SetRtspHandler(m_iRtspHandler==0?RealMedia:m_iRtspHandler==1?QuickTime:DirectShow, !!m_fRtspFileExtFirst);
- RebuildIconsCache();
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
return __super::OnApply();
}
|