Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Theme activation error

1 view
Skip to first unread message

vas...@gmail.com

unread,
Aug 14, 2008, 7:06:05 AM8/14/08
to
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, &amppi))
{
::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!

0 new messages