Added Themes submenu to the Rainmeter's context and tray menus.

This commit is contained in:
Kimmo Pekkola
2009-08-12 17:11:52 +00:00
parent c895803238
commit 1d1290e3fa
4 changed files with 87 additions and 2 deletions

View File

@ -466,6 +466,13 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
std::wstring command = Rainmeter->GetConfigEditor();
command += L" \"";
command += Rainmeter->GetIniFile();
command += L"\"";
LSExecute(tray->GetWindow(), command.c_str(), SW_SHOWNORMAL);
}
else if(wParam == ID_CONTEXT_MANAGETHEMES)
{
std::wstring command = Rainmeter->GetPath();
command += L"\\Addons\\RainThemes\\RainThemes.exe";
LSExecute(tray->GetWindow(), command.c_str(), SW_SHOWNORMAL);
}
else if(wParam == ID_CONTEXT_QUIT)
@ -481,6 +488,20 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
command += L"\"";
LSExecute(tray->GetWindow(), command.c_str(), SW_SHOWNORMAL);
}
else if((wParam & 0x0ffff) >= ID_THEME_FIRST)
{
int pos = (wParam & 0x0ffff) - ID_THEME_FIRST;
const std::vector<std::wstring>& themes = Rainmeter->GetAllThemes();
if (pos >= 0 && pos < themes.size())
{
std::wstring command = Rainmeter->GetPath();
command += L"\\Addons\\RainThemes\\RainThemes.exe /load \"";
command += themes[pos];
command += L"\"";
LSExecute(tray->GetWindow(), command.c_str(), SW_SHOWNORMAL);
}
}
else if((wParam & 0x0ffff) >= ID_CONFIG_FIRST)
{
wParam = wParam & 0x0ffff;