- Manage Themes: Fixed that loaded wallpaper was not set permanently

- Fixed that default language detection failed on 64bit Rainmeter
- Installer now remembers language selection
- Fixed that Build.bat didn't work with TortoiseSVN 1.7 (recent version of TortoiseSVN now required to use Build.bat/UpdateVersion.bat)
This commit is contained in:
Birunthan Mohanathas 2011-10-14 14:53:02 +00:00
parent 7790449f2a
commit 3e7de9c573
2 changed files with 15 additions and 16 deletions

View File

@ -1050,21 +1050,23 @@ int CRainmeter::Initialize(HWND hParent, HINSTANCE hInstance, LPCWSTR szPath)
// Determine the language resource to load // Determine the language resource to load
std::wstring resource = m_Path + L"Languages\\"; std::wstring resource = m_Path + L"Languages\\";
if (GetPrivateProfileString(L"Rainmeter", L"Language", L"", tmpSzPath, MAX_LINE_LENGTH, m_IniFile.c_str()) > 0) if (GetPrivateProfileString(L"Rainmeter", L"Language", L"", tmpSzPath, MAX_LINE_LENGTH, m_IniFile.c_str()) == 0)
{
m_ResourceLCID = wcstoul(tmpSzPath, NULL, 10);
}
else
{ {
// Use whatever the user selected for the installer // Use whatever the user selected for the installer
DWORD lang; DWORD size = MAX_LINE_LENGTH;
DWORD size = sizeof(DWORD); HKEY hKey;
if (SHGetValue(HKEY_LOCAL_MACHINE, L"Software\\Rainmeter", L"Language", NULL, &lang, &size) == ERROR_SUCCESS) if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Rainmeter", 0, KEY_QUERY_VALUE | KEY_WOW64_32KEY, &hKey) == ERROR_SUCCESS)
{ {
_ultow(lang, tmpSzPath, 10); DWORD type = 0;
m_ResourceLCID = lang; if (RegQueryValueEx(hKey, L"Language", NULL, &type, (LPBYTE)tmpSzPath, (LPDWORD)&size) != ERROR_SUCCESS ||
type != REG_SZ)
{
tmpSzPath = L'\0';
}
RegCloseKey(hKey);
} }
} }
m_ResourceLCID = wcstoul(tmpSzPath, NULL, 10);
resource += tmpSzPath; resource += tmpSzPath;
resource += L".dll"; resource += L".dll";
@ -2167,7 +2169,7 @@ void CRainmeter::ExecuteCommand(const WCHAR* command, CMeterWindow* meterWindow)
{ {
// Fake WM_COPYDATA to deliver bangs // Fake WM_COPYDATA to deliver bangs
COPYDATASTRUCT cds; COPYDATASTRUCT cds;
cds.cbData = (DWORD)((wcslen(command) + 1) * sizeof(WCHAR)); cds.cbData = 1; // Size doesn't matter as long as not empty
cds.dwData = 1; cds.dwData = 1;
cds.lpData = (void*)command; cds.lpData = (void*)command;
meterWindow->OnCopyData(WM_COPYDATA, NULL, (LPARAM)&cds); meterWindow->OnCopyData(WM_COPYDATA, NULL, (LPARAM)&cds);
@ -2494,9 +2496,6 @@ void CRainmeter::LoadTheme(const std::wstring& name)
theme += L"\\Rainmeter.thm"; theme += L"\\Rainmeter.thm";
CSystem::CopyFiles(theme, Rainmeter->GetIniFile()); CSystem::CopyFiles(theme, Rainmeter->GetIniFile());
/*
TODO fix me
*/
PreserveSetting(backup, L"SkinPath"); PreserveSetting(backup, L"SkinPath");
PreserveSetting(backup, L"ConfigEditor"); PreserveSetting(backup, L"ConfigEditor");
PreserveSetting(backup, L"LogViewer"); PreserveSetting(backup, L"LogViewer");
@ -2512,7 +2511,7 @@ void CRainmeter::LoadTheme(const std::wstring& name)
// Set wallpaper if it exists // Set wallpaper if it exists
if (_waccess(wallpaper.c_str(), 0) != -1) if (_waccess(wallpaper.c_str(), 0) != -1)
{ {
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), 0); SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), SPIF_UPDATEINIFILE);
} }
} }

View File

@ -578,7 +578,7 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
GetCursorPos(&point); GetCursorPos(&point);
Rainmeter->ShowContextMenu(point, NULL); Rainmeter->ShowContextMenu(point, NULL);
} }
else if (uMouseMsg == WM_LBUTTONDOWN) else if (uMouseMsg == WM_LBUTTONDOWN || uMouseMsg == WM_LBUTTONDBLCLK)
{ {
CDialogManage::Open(); CDialogManage::Open();
} }