summaryrefslogtreecommitdiff
path: root/updater/progress_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'updater/progress_dialog.cpp')
-rw-r--r--updater/progress_dialog.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/updater/progress_dialog.cpp b/updater/progress_dialog.cpp
index 0ee0726..3fedf6f 100644
--- a/updater/progress_dialog.cpp
+++ b/updater/progress_dialog.cpp
@@ -30,7 +30,8 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
PostMessage(hwndDlg, WMU_SETPROGRESS, 0, 0);
return FALSE;
case WM_TIMER:
- if(wParam == ID_PROGTIMER) {
+ if(wParam == ID_PROGTIMER)
+ {
TCHAR text[512];
GetDlgItemText(hwndDlg, IDC_PROGMSG, text, 512);
size_t len = _tcslen(text);
@@ -58,7 +59,7 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
TCHAR buff[512];
- _stprintf(buff, TranslateT("Progress - %d%%"), wParam);
+ mir_sntprintf(buff, SIZEOF(buff), TranslateT("Progress - %d%%"), wParam);
SetWindowText(hwndDlg, buff);
}
return TRUE;
@@ -82,8 +83,6 @@ INT_PTR CALLBACK DlgProcProgress(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
//DWORD CALLBACK ProgressWindowThread(LPVOID param) {
unsigned int CALLBACK ProgressWindowThread(void *param) {
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
-
if(param) SetEvent((HANDLE)param);
MSG hwndMsg = {0};
@@ -115,13 +114,12 @@ unsigned int CALLBACK ProgressWindowThread(void *param) {
if(hwndProgress) DestroyWindow(hwndProgress);
hwndProgress = 0;
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
return 0;
}
void MakeProgressWindowThread() {
hProgSyncEvent = CreateEvent(0, 0, 0, 0);
- CloseHandle((HANDLE)_beginthreadex(0, 0, ProgressWindowThread, hProgSyncEvent, 0, &dwProgressThreadId));
+ CloseHandle(mir_forkthreadex(ProgressWindowThread, hProgSyncEvent, 0, &dwProgressThreadId));
WaitForSingleObject(hProgSyncEvent, INFINITE);
}