Added !SetWallpaper bang.

Usage: !SetWallpaper [File] (Style)
where style is CENTER, TILE, STRETCH, FIT, or FILL. FIT/FILL available only on Windows 7 (and higher).
This commit is contained in:
Birunthan Mohanathas
2012-02-04 15:54:30 +00:00
parent 913cf05a18
commit 405976b7a6
4 changed files with 121 additions and 9 deletions

View File

@ -420,6 +420,30 @@ void CRainmeter::Bang_SetClip(const WCHAR* arg)
}
}
/*
** Bang_SetWallpaper
**
** !SetWallpaper bang
**
*/
void CRainmeter::Bang_SetWallpaper(const WCHAR* arg)
{
std::vector<std::wstring> subStrings = ParseString(arg);
if (subStrings.size() == 1)
{
CSystem::SetWallpaper(subStrings[0], L"");
}
else if (subStrings.size() == 2)
{
CSystem::SetWallpaper(subStrings[0], subStrings[1]);
}
else
{
Log(LOG_ERROR, L"!SetWallpaper: Invalid parameters");
}
}
/*
** Bang_SkinMenu
**
@ -1756,6 +1780,10 @@ void CRainmeter::ExecuteBang(const std::wstring& name, std::wstring& arg, CMeter
{
Bang_SetClip(args);
}
else if (_wcsicmp(bang, L"SetWallpaper") == 0)
{
Bang_SetWallpaper(args);
}
else if (_wcsicmp(bang, L"About") == 0)
{
CDialogAbout::Open(args);