git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17067
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#include "wx/app.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/app.h"
#include "wx/intl.h"
#include "wx/log.h"
-#if wxUSE_GUI // See 'dirty hack' below.
- #include "wx/frame.h"
-#endif
+ #if wxUSE_GUI // See 'dirty hack' below.
+ #include "wx/frame.h"
+ #endif
// thread function for the thread monitoring the process termination
static DWORD __stdcall wxExecuteThread(void *arg)
{
// thread function for the thread monitoring the process termination
static DWORD __stdcall wxExecuteThread(void *arg)
{
- wxExecuteData *data = (wxExecuteData*)arg;
+ wxExecuteData * const data = (wxExecuteData *)arg;
if ( ::WaitForSingleObject(data->hProcess, INFINITE) != WAIT_OBJECT_0 )
{
if ( ::WaitForSingleObject(data->hProcess, INFINITE) != WAIT_OBJECT_0 )
{
{
DestroyWindow(hWnd); // we don't need it any more
{
DestroyWindow(hWnd); // we don't need it any more
- wxExecuteData *data = (wxExecuteData *)lParam;
+ wxExecuteData * const data = (wxExecuteData *)lParam;
if ( data->handler )
{
data->handler->OnTerminate((int)data->dwProcessId,
if ( data->handler )
{
data->handler->OnTerminate((int)data->dwProcessId,
- return DefWindowProc(hWnd, message, wParam, lParam);
+ return ::DefWindowProc(hWnd, message, wParam, lParam);
// real async IO which we don't have for the moment
::Sleep(50);
// real async IO which we don't have for the moment
::Sleep(50);
// repaint the GUI
wxYield();
// repaint the GUI
wxYield();
+#else // !GUI
+ // dispatch the messages to the hidden window so that it could
+ // process the wxWM_PROC_TERMINATED notification
+ MSG msg;
+ ::PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE);
+#endif // GUI/!GUI