mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	Fixed the crash problem when multiple Rainmeter instances are running and "show desktop" occured.
This commit is contained in:
		| @@ -1472,6 +1472,22 @@ CMeterWindow* CRainmeter::GetMeterWindow(const std::wstring& config) | |||||||
|  |  | ||||||
| 	return NULL; | 	return NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | CMeterWindow* CRainmeter::GetMeterWindow(HWND hwnd) | ||||||
|  | { | ||||||
|  | 	std::map<std::wstring, CMeterWindow*>::iterator iter = m_Meters.begin(); | ||||||
|  |  | ||||||
|  | 	for (; iter != m_Meters.end(); iter++) | ||||||
|  | 	{ | ||||||
|  | 		if ((*iter).second->GetWindow() == hwnd) | ||||||
|  | 		{ | ||||||
|  | 			return (*iter).second; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
| /*  | /*  | ||||||
| ** Quit | ** Quit | ||||||
| ** | ** | ||||||
|   | |||||||
| @@ -112,6 +112,7 @@ public: | |||||||
| 	CTrayWindow* GetTrayWindow() { return m_TrayWindow; }; | 	CTrayWindow* GetTrayWindow() { return m_TrayWindow; }; | ||||||
|  |  | ||||||
| 	CMeterWindow* GetMeterWindow(const std::wstring& config); | 	CMeterWindow* GetMeterWindow(const std::wstring& config); | ||||||
|  | 	CMeterWindow* GetMeterWindow(HWND hwnd); | ||||||
| 	std::map<std::wstring, CMeterWindow*>& GetAllMeterWindows() { return m_Meters; }; | 	std::map<std::wstring, CMeterWindow*>& GetAllMeterWindows() { return m_Meters; }; | ||||||
| 	const std::vector<CONFIG>& GetAllConfigs() { return m_ConfigStrings; }; | 	const std::vector<CONFIG>& GetAllConfigs() { return m_ConfigStrings; }; | ||||||
| 	const std::vector<std::wstring>& GetAllThemes() { return m_Themes; }; | 	const std::vector<std::wstring>& GetAllThemes() { return m_Themes; }; | ||||||
|   | |||||||
| @@ -581,7 +581,8 @@ BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam) | |||||||
|  |  | ||||||
| 	if (GetClassName(hwnd, className, 128) > 0 && | 	if (GetClassName(hwnd, className, 128) > 0 && | ||||||
| 		wcscmp(className, L"RainmeterMeterWindow") == 0 && | 		wcscmp(className, L"RainmeterMeterWindow") == 0 && | ||||||
| 		(Window = (CMeterWindow*)GetProp(hwnd, L"RAINMETER"))) | 		Rainmeter && | ||||||
|  | 		(Window = Rainmeter->GetMeterWindow(hwnd))) | ||||||
| 	{ | 	{ | ||||||
| 		if (Window->GetWindowZPosition() == ZPOSITION_ONDESKTOP) | 		if (Window->GetWindowZPosition() == ZPOSITION_ONDESKTOP) | ||||||
| 		{ | 		{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 spx
					spx