summaryrefslogtreecommitdiff
path: root/plugins/DbChecker
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-11-25 17:36:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-11-25 17:36:11 +0300
commite23a1b7001f133785df96f8b3968f659f87f7d56 (patch)
treef6b1eeee1afb00d481cd5d78d1112954d61d2167 /plugins/DbChecker
parente23832441f6c5499673982ff7c3659f8f5728e30 (diff)
patch that really fixes #2628
Diffstat (limited to 'plugins/DbChecker')
-rw-r--r--plugins/DbChecker/src/progress.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp
index 9d06f8332f..55f55b3a43 100644
--- a/plugins/DbChecker/src/progress.cpp
+++ b/plugins/DbChecker/src/progress.cpp
@@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#define WM_PROCESSINGDONE (WM_USER+1)
+#define WM_ADDMESSAGE (WM_USER+2)
void __cdecl WorkerThread(DbToolOptions *opts);
static HWND hwndStatus, hdlgProgress, hwndBar;
@@ -35,10 +36,7 @@ void AddToStatus(int flags, const wchar_t* fmt, ...)
mir_vsnwprintf(str, _countof(str), fmt, vararg);
va_end(vararg);
- int i = SendMessage(hwndStatus, LB_ADDSTRING, 0, (LPARAM)str);
- SendMessage(hwndStatus, LB_SETITEMDATA, i, flags);
- InvalidateRect(hwndStatus, nullptr, FALSE);
- SendMessage(hwndStatus, LB_SETTOPINDEX, i, 0);
+ PostMessage(hdlgProgress, WM_ADDMESSAGE, WPARAM(mir_wstrdup(str)), flags);
#ifdef _DEBUG
OutputDebugString(str);
@@ -169,6 +167,16 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
}
break;
+ case WM_ADDMESSAGE:
+ {
+ int i = SendMessage(hwndStatus, LB_ADDSTRING, 0, wParam);
+ SendMessage(hwndStatus, LB_SETITEMDATA, i, lParam);
+ InvalidateRect(hwndStatus, nullptr, FALSE);
+ SendMessage(hwndStatus, LB_SETTOPINDEX, i, 0);
+ mir_free((void *)wParam);
+ }
+ break;
+
case WZN_CANCELCLICKED:
ResetEvent(opts->hEventRun);
if (opts->bFinished)