mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
New !bang: !RainmeterQuit
This commit is contained in:
parent
848cd361e3
commit
e73d35e220
@ -668,6 +668,11 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case BANG_QUIT:
|
||||
if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0);
|
||||
quitModule(Rainmeter->GetInstance());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ enum BANGCOMMAND
|
||||
BANG_LSHOOK,
|
||||
BANG_ABOUT,
|
||||
BANG_MOVEMETER,
|
||||
BANG_PLUGIN
|
||||
BANG_PLUGIN,
|
||||
BANG_QUIT
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
@ -569,6 +569,17 @@ void RainmeterPluginBang(HWND, const char* arg)
|
||||
BangWithArgs(BANG_PLUGIN, ConvertToWide(arg).c_str(), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** RainmeterQuit
|
||||
**
|
||||
** Callback for the !RainmeterQuit bang
|
||||
**
|
||||
*/
|
||||
void RainmeterQuit(HWND, const char* arg)
|
||||
{
|
||||
BangWithArgs(BANG_QUIT, ConvertToWide(arg).c_str(), 0);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------
|
||||
//
|
||||
// The class starts here
|
||||
@ -879,6 +890,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
|
||||
AddBangCommand("!RainmeterResetStats", RainmeterResetStats);
|
||||
AddBangCommand("!RainmeterMoveMeter", RainmeterMoveMeter);
|
||||
AddBangCommand("!RainmeterPluginBang", RainmeterPluginBang);
|
||||
AddBangCommand("!RainmeterQuit", RainmeterQuit);
|
||||
}
|
||||
|
||||
// Create meter windows for active configs
|
||||
@ -1135,6 +1147,7 @@ void CRainmeter::Quit(HINSTANCE dllInst)
|
||||
RemoveBangCommand("!RainmeterResetStats");
|
||||
RemoveBangCommand("!RainmeterMoveMeter");
|
||||
RemoveBangCommand("!RainmeterPluginBang");
|
||||
RemoveBangCommand("!RainmeterQuit");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1289,7 +1302,7 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
|
||||
{
|
||||
BangWithArgs(BANG_MOVE, arg.c_str(), 2);
|
||||
}
|
||||
else if (wcsicmp(bang.c_str(), L"!RainmeterChangeZPos") == 0) // For backwards combatibility
|
||||
else if (wcsicmp(bang.c_str(), L"!RainmeterChangeZPos") == 0) // For backwards compatibility
|
||||
{
|
||||
BangWithArgs(BANG_ZPOS, arg.c_str(), 1);
|
||||
}
|
||||
@ -1317,6 +1330,10 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
|
||||
{
|
||||
// Nothing to do here (this works only with Litestep)
|
||||
}
|
||||
else if (wcsicmp(bang.c_str(), L"!RainmeterQuit") == 0)
|
||||
{
|
||||
BangWithArgs(BANG_QUIT, arg.c_str(), 0);
|
||||
}
|
||||
else if (wcsicmp(bang.c_str(), L"!Execute") == 0)
|
||||
{
|
||||
// Special case for multibang execution
|
||||
|
@ -69,6 +69,7 @@ void RainmeterAbout(HWND, const char* arg);
|
||||
void RainmeterResetStats(HWND, const char* arg);
|
||||
void RainmeterMoveMeter(HWND, const char* arg);
|
||||
void RainmeterPluginBang(HWND, const char* arg);
|
||||
void RainmeterQuit(HWND, const char* arg);
|
||||
|
||||
void BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user