summaryrefslogtreecommitdiff
path: root/updater/progress_dialog.cpp
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-02-21 23:00:56 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-02-21 23:00:56 +0000
commit8f5a7b54eb953bbfc877ec915e26b3a95ec28d00 (patch)
tree827e40ab3528e10afd6fcb44f7ed5db0d7eed519 /updater/progress_dialog.cpp
parentb130e8caa16961f597ae4ac6984a6aa00de7b6c7 (diff)
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
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);
}