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:
		| @@ -668,6 +668,11 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		break; | 		break; | ||||||
|  |  | ||||||
|  | 	case BANG_QUIT: | ||||||
|  | 		if (Rainmeter->GetDummyLitestep()) PostQuitMessage(0); | ||||||
|  | 		quitModule(Rainmeter->GetInstance()); | ||||||
|  | 		break; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -96,7 +96,8 @@ enum BANGCOMMAND | |||||||
| 	BANG_LSHOOK, | 	BANG_LSHOOK, | ||||||
| 	BANG_ABOUT, | 	BANG_ABOUT, | ||||||
| 	BANG_MOVEMETER, | 	BANG_MOVEMETER, | ||||||
| 	BANG_PLUGIN | 	BANG_PLUGIN, | ||||||
|  | 	BANG_QUIT | ||||||
| }; | }; | ||||||
|  |  | ||||||
| typedef struct  | typedef struct  | ||||||
|   | |||||||
| @@ -569,6 +569,17 @@ void RainmeterPluginBang(HWND, const char* arg) | |||||||
| 	BangWithArgs(BANG_PLUGIN, ConvertToWide(arg).c_str(), 1); | 	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 | //                                The class starts here | ||||||
| @@ -879,6 +890,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath) | |||||||
| 		AddBangCommand("!RainmeterResetStats", RainmeterResetStats); | 		AddBangCommand("!RainmeterResetStats", RainmeterResetStats); | ||||||
| 		AddBangCommand("!RainmeterMoveMeter", RainmeterMoveMeter); | 		AddBangCommand("!RainmeterMoveMeter", RainmeterMoveMeter); | ||||||
| 		AddBangCommand("!RainmeterPluginBang", RainmeterPluginBang); | 		AddBangCommand("!RainmeterPluginBang", RainmeterPluginBang); | ||||||
|  | 		AddBangCommand("!RainmeterQuit", RainmeterQuit); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// Create meter windows for active configs | 	// Create meter windows for active configs | ||||||
| @@ -1135,6 +1147,7 @@ void CRainmeter::Quit(HINSTANCE dllInst) | |||||||
| 		RemoveBangCommand("!RainmeterResetStats"); | 		RemoveBangCommand("!RainmeterResetStats"); | ||||||
| 		RemoveBangCommand("!RainmeterMoveMeter"); | 		RemoveBangCommand("!RainmeterMoveMeter"); | ||||||
| 		RemoveBangCommand("!RainmeterPluginBang"); | 		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); | 		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); | 		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) | 		// 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) | 	else if (wcsicmp(bang.c_str(), L"!Execute") == 0) | ||||||
| 	{ | 	{ | ||||||
| 		// Special case for multibang execution | 		// Special case for multibang execution | ||||||
|   | |||||||
| @@ -69,6 +69,7 @@ void RainmeterAbout(HWND, const char* arg); | |||||||
| void RainmeterResetStats(HWND, const char* arg); | void RainmeterResetStats(HWND, const char* arg); | ||||||
| void RainmeterMoveMeter(HWND, const char* arg); | void RainmeterMoveMeter(HWND, const char* arg); | ||||||
| void RainmeterPluginBang(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); | void BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kimmo Pekkola
					Kimmo Pekkola