diff options
author | Robert Pösel <robyer@seznam.cz> | 2017-02-06 03:00:34 +0100 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2017-02-06 03:00:34 +0100 |
commit | 428f4fe793688a84c0bc70f8a6d35e5f802698ae (patch) | |
tree | f448dece52ba56e934297fcbe35f20daeb39773f /plugins | |
parent | 6807cde64f65d5fa6617c8c29f7e2aa00cbc5b6d (diff) |
Msg_Export: Fix opening/closing progress dialog
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/Msg_Export/src/options.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 575eed291c..9a95d3c134 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -128,8 +128,8 @@ int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) INT_PTR CALLBACK __stdcall DialogProc(
HWND hwndDlg, // handle to dialog box
UINT uMsg, // message
- WPARAM /*wParam*/, // first message parameter
- LPARAM /*lParam*/ // second message parameter
+ WPARAM wParam, // first message parameter
+ LPARAM lParam // second message parameter
)
{
switch (uMsg) {
@@ -138,6 +138,12 @@ INT_PTR CALLBACK __stdcall DialogProc( TranslateDialogDefault(hwndDlg);
return TRUE;
}
+ case WM_CLOSE:
+ {
+ if (lParam > 0)
+ DestroyWindow(hwndDlg);
+ return TRUE;
+ }
}
return FALSE;
}
@@ -155,7 +161,6 @@ void exportContactsMessages(void *p) HWND hProg = GetDlgItem(hDlg, IDC_EXPORT_PROGRESS);
HWND hStatus = GetDlgItem(hDlg, IDC_EXP_ALL_STATUS);
- ShowWindow(hDlg, SW_SHOWNORMAL);
SendMessage(hProg, PBM_SETRANGE, 0, MAKELPARAM(0, data->contacts.size() - 1));
SetWindowText(hStatus, TranslateT("Reading database information (Phase 1 of 2)"));
@@ -231,10 +236,9 @@ void exportContactsMessages(void *p) SendMessage(hProg, PBM_SETPOS, ++nCur, 0);
RedrawWindow(hDlg, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW);
- UpdateWindow(hDlg);
}
- DestroyWindow(hDlg);
+ SendMessage(hDlg, WM_CLOSE, 0, 1);
}
/////////////////////////////////////////////////////////////////////
@@ -293,6 +297,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected) // Create progress dialog
HWND hDlg = data->hDialog = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXPORT_ALL_DLG), NULL, DialogProc);
+ ShowWindow(hDlg, SW_SHOWNORMAL);
// Process the export in other thread
mir_forkthread(&exportContactsMessages, data);
|