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
 
 
 // the DialogProc for all wxWindows dialogs
 LONG APIENTRY _EXPORT
-wxDlgProc(HWND WXUNUSED(hDlg),
+wxDlgProc(HWND hDlg,
           UINT message,
           WPARAM WXUNUSED(wParam),
           LPARAM WXUNUSED(lParam))
             // 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