Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Thu, 14 Aug 2008 04:06:05 -0700 (PDT),    group: microsoft.public.win32.programmer.wince        back       


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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us