diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 77b68389..06849984 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -842,9 +842,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) DWORD lExitCode; while (WaitForSingleObject(hProc,100) == WAIT_TIMEOUT) { - MSG msg; - while (PeekMessage(&msg,NULL,WM_PAINT,WM_PAINT,PM_REMOVE)) - DispatchMessage(&msg); + MessageLoop(WM_PAINT); } GetExitCodeProcess(hProc, &lExitCode); diff --git a/Source/exehead/fileform.c b/Source/exehead/fileform.c index 4515b3f0..3f8029fb 100644 --- a/Source/exehead/fileform.c +++ b/Source/exehead/fileform.c @@ -194,8 +194,7 @@ const char * NSISCALL loadHeaders(int cl_flags) { if (hwnd) { - MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + MessageLoop(0); } else if (GetTickCount() > verify_time) hwnd = CreateDialogParam( @@ -450,9 +449,8 @@ static int NSISCALL __ensuredata(int amount) { if (hwnd) { - MSG msg; m_pos=m_length-(amount-(dbd_size-dbd_pos)); - while (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) DispatchMessage(&msg); + MessageLoop(0); } else if (GetTickCount() > verify_time) { diff --git a/Source/exehead/util.c b/Source/exehead/util.c index 1432749b..44808dcf 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -796,3 +796,10 @@ void * NSISCALL myGetProcAddress(char *dll, char *func) return GetProcAddress(hModule, func); } + +void NSISCALL MessageLoop(UINT uCheckedMsg) +{ + MSG msg; + while (PeekMessage(&msg, NULL, uCheckedMsg, uCheckedMsg, PM_REMOVE)) + DispatchMessage(&msg); +} diff --git a/Source/exehead/util.h b/Source/exehead/util.h index db99f2be..f285646a 100644 --- a/Source/exehead/util.h +++ b/Source/exehead/util.h @@ -71,6 +71,7 @@ void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew); void NSISCALL mini_memcpy(void *out, const void *in, int len); void * NSISCALL myGetProcAddress(char *dll, char *func); +void NSISCALL MessageLoop(UINT uCheckedMsg); // Turn a pair of chars into a word // Turn four chars into a dword