From 62c0268fef200aba76a7808e251c64bd37e98d7c Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 4 Jun 2011 08:39:05 +0000 Subject: [PATCH] WebParser: Changed FinishAction to be sent the !bang to the appropriate skin without #CURRENTCONFIG#. --- Plugins/PluginWebParser/WebParser.cpp | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Plugins/PluginWebParser/WebParser.cpp b/Plugins/PluginWebParser/WebParser.cpp index 49faed91..c6c30963 100644 --- a/Plugins/PluginWebParser/WebParser.cpp +++ b/Plugins/PluginWebParser/WebParser.cpp @@ -534,7 +534,7 @@ bool BelongToSameProcess(HWND wnd) return (procId == GetCurrentProcessId()); } -HWND FindMeterWindow(HWND parent = NULL) +HWND FindMeterWindow(HWND parent) { HWND wnd = NULL; @@ -546,22 +546,22 @@ HWND FindMeterWindow(HWND parent = NULL) } } - // for backward compatibility (0.14 - 1.1) - if (!parent) + return NULL; +} + +HWND FindMeterWindow(const std::wstring& iniFile) +{ + std::wstring str = PluginBridge(L"getconfig", iniFile.c_str()); + if (!str.empty()) { - while (parent = FindWindowEx(NULL, parent, L"Progman", NULL)) + str = PluginBridge(L"getwindow", str.c_str()); + if (str != L"error") { - if (wnd = FindMeterWindow(parent)) - { - if (BelongToSameProcess(wnd)) - { - return wnd; - } - } + return (HWND)UlongToPtr(wcstoul(str.c_str(), NULL, 10)); } } - return NULL; + return FindMeterWindow(NULL); // Use old way to find } /* @@ -1117,7 +1117,7 @@ void ParseData(UrlData* urlData, LPCSTR parseData) { if (!urlData->finishAction.empty()) { - HWND wnd = FindMeterWindow(); + HWND wnd = FindMeterWindow(urlData->iniFile); if (wnd != NULL) { @@ -1424,7 +1424,7 @@ unsigned __stdcall NetworkDownloadThreadProc(void* pParam) if (!urlData->finishAction.empty()) { - HWND wnd = FindMeterWindow(); + HWND wnd = FindMeterWindow(urlData->iniFile); if (wnd != NULL) {