diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index fdc4bf3a2e..2b891ad626 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -440,6 +440,22 @@ WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPar switch ( message ) { +#ifdef __WXWINCE__ + // react to pressing the OK button in the title + case WM_COMMAND: + if (LOWORD(wParam) == IDOK) + { + wxButton *btn = wxDynamicCast(FindWindow(wxID_CANCEL), wxButton); + if ( btn && btn->IsEnabled() ) + { + // if we do have a cancel button, do press it + btn->MSWCommand(BN_CLICKED, 0 /* unused */); + processed = TRUE; + break; + } + } + break; +#endif case WM_CLOSE: // if we can't close, tell the system that we processed the // message - otherwise it would close us diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index ee7bed0b1f..b7f00bb6c7 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -915,7 +915,7 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) // the DialogProc for all wxWindows dialogs LONG APIENTRY _EXPORT -wxDlgProc(HWND WXUNUSED(hDlg), +wxDlgProc(HWND hDlg, UINT message, WPARAM WXUNUSED(wParam), LPARAM WXUNUSED(lParam)) @@ -926,6 +926,16 @@ wxDlgProc(HWND WXUNUSED(hDlg), // for this message, returning TRUE tells system to set focus to // the first control in the dialog box, but as we set the focus // ourselves, we return FALSE from here as well, so fall through +#ifdef __WXWINCE__ + { + SHINITDLGINFO shidi; + shidi.dwMask = SHIDIM_FLAGS; + shidi.dwFlags = SHIDIF_DONEBUTTON | + SHIDIF_SIZEDLGFULLSCREEN; + shidi.hDlg = hDlg; + SHInitDialog( &shidi ); + } +#endif default: // for all the other ones, FALSE means that we didn't process the