Minor code tweaks.

This commit is contained in:
spx
2012-02-07 08:32:37 +00:00
parent b5530163a2
commit 1e88fe1db3
3 changed files with 10 additions and 22 deletions

View File

@ -679,16 +679,8 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
if (cds->dwData == RAINMETER_QUERY_ID_SKIN_WINDOWHANDLE)
{
LPCWSTR configName = (LPCWSTR)cds->lpData;
const std::map<std::wstring, CMeterWindow*>& windows = Rainmeter->GetAllMeterWindows();
std::map<std::wstring, CMeterWindow*>::const_iterator iter = windows.begin();
for ( ; iter != windows.end(); ++iter)
{
if (wcscmp((*iter).first.c_str(), configName) == 0)
{
return (LRESULT)(*iter).second->GetWindow();
}
}
return NULL;
CMeterWindow* mw = Rainmeter->GetMeterWindow(configName);
return (mw) ? (LRESULT)mw->GetWindow() : NULL;
}
}
return 1;