mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user