Theme activation error
Hello,
my program need to apply the company theme. The code work perfect
under PocketPC 2003 but there are few problems with the WM2005 /
MW2006 platforms (the only changed items are the wallpaper and the
menu background):
void CSysManager::applyTheme(const TCHAR* pchTheme)
{
HKEY hKey;
LONG lRet;
TCHAR szCmdLine[MAX_PATH+1];
PROCESS_INFORMATION amppi;
// Set the theme
lRet = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\
\Today"), 0, 0, &hKey);
if(ERROR_SUCCESS == lRet)
{
RegDeleteValue(hKey, _T("UseStartImage"));
wcscpy(szCmdLine, _T("/safe /noui /nouninstall /delete 0 \""));
wcscat(szCmdLine, pchTheme);
wcscat(szCmdLine, _T("\""));
if(::CreateProcess(_T("\\Windows\\wceload.exe"),
szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi))
{
::WaitForSingleObject(amppi.hProcess, INFINITE);
RegSetValueEx(hKey, _T("Skin"), 0, REG_SZ, (BYTE*)pchTheme,
sizeof(TCHAR) * (wcslen(pchTheme) + 1));
RegCloseKey(hKey);
}
// Broadcast the update today message
::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
}
Any help is very welcome!
date: Thu, 14 Aug 2008 04:06:05 -0700 (PDT)
author: unknown