From 8f5a7b54eb953bbfc877ec915e26b3a95ec28d00 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Sun, 21 Feb 2010 23:00:56 +0000 Subject: New updater with 3x reduced footprint and fully W7 and x64 compatible git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@476 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/progress_dialog.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'updater/progress_dialog.cpp') 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); } -- cgit v1.2.3