brunoisa10
05-05-2008, 10:49 PM
Hi All
Ive found this code , can you tell me what is this language
It is a sample to be able to change automatically themes in the Pocket PC
Can you help me ,making an exe with theme in parameters if possible ?
HKEY hKey;
LONG lRet;
TCHAR szCmdLine[MAX_PATH+1];
TCHAR* pszFile = _T("\\Windows\\Fire.tsk"); // The theme file
//
// 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, pszFile);
if(::CreateProcess(_T("\\Windows\\wceload.exe"),
szCmdLine,
NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi))
{
::WaitForSingleObject(pi.hProcess, INFINITE);
RegSetValueEx(hKey, _T("Skin"), 0, REG_SZ, (BYTE*)pszFile,
sizeof(TCHAR) * (wcslen(pszFile) + 1));
RegCloseKey(hKey);
}
//
// Broadcast the update today message
//
::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
the last line code is named : The Magical touch
I've tried near the same with Mortscript but it doesn't work always .
seems to work only when there is a reg key UseStartImage (this one deleted first in this program)
I don't understand the value &pi in the call of wceload
anyone can help me ?
Ive found this code , can you tell me what is this language
It is a sample to be able to change automatically themes in the Pocket PC
Can you help me ,making an exe with theme in parameters if possible ?
HKEY hKey;
LONG lRet;
TCHAR szCmdLine[MAX_PATH+1];
TCHAR* pszFile = _T("\\Windows\\Fire.tsk"); // The theme file
//
// 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, pszFile);
if(::CreateProcess(_T("\\Windows\\wceload.exe"),
szCmdLine,
NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi))
{
::WaitForSingleObject(pi.hProcess, INFINITE);
RegSetValueEx(hKey, _T("Skin"), 0, REG_SZ, (BYTE*)pszFile,
sizeof(TCHAR) * (wcslen(pszFile) + 1));
RegCloseKey(hKey);
}
//
// Broadcast the update today message
//
::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
the last line code is named : The Magical touch
I've tried near the same with Mortscript but it doesn't work always .
seems to work only when there is a reg key UseStartImage (this one deleted first in this program)
I don't understand the value &pi in the call of wceload
anyone can help me ?