#include "wx/msw/wrapcctl.h"
+// For MB_TASKMODAL
+#ifdef __WXWINCE__
+#include "wx/msw/wince/missing.h"
+#endif
+
#if (!defined(__MINGW32__) || wxCHECK_W32API_VERSION( 2, 0 )) && \
!defined(__CYGWIN__) && !defined(__DIGITALMARS__) && !defined(__WXWINCE__) && \
(!defined(_MSC_VER) || (_MSC_VER > 1100))
// NB: all "NoRedraw" classes must have the same names as the "normal" classes
// with NR suffix - wxWindow::MSWCreate() supposes this
+#ifdef __WXWINCE__
+ wxChar *wxCanvasClassName;
+ wxChar *wxCanvasClassNameNR;
+#else
const wxChar *wxCanvasClassName = wxT("wxWindowClass");
const wxChar *wxCanvasClassNameNR = wxT("wxWindowClassNR");
+#endif
const wxChar *wxMDIFrameClassName = wxT("wxMDIFrameClass");
const wxChar *wxMDIFrameClassNameNoRedraw = wxT("wxMDIFrameClassNR");
const wxChar *wxMDIChildFrameClassName = wxT("wxMDIChildFrameClass");
// ensure that base cleanup is done if we return too early
wxCallBaseCleanup callBaseCleanup(this);
+#ifdef __WXWINCE__
+ wxString tmp = GetAppName();
+ tmp += wxT("ClassName");
+ wxCanvasClassName = wxStrdup( tmp.c_str() );
+ tmp += wxT("NR");
+ wxCanvasClassNameNR = wxStrdup( tmp.c_str() );
+ HWND hWnd = FindWindow( wxCanvasClassNameNR, NULL );
+ if (hWnd)
+ {
+ SetForegroundWindow( (HWND)(((DWORD)hWnd)|0x01) );
+ return false;
+ }
+#endif
+
// the first thing to do is to check if we're trying to run an Unicode
// program under Win9x w/o MSLU emulation layer - if so, abort right now
// as it has no chance to work
(
NULL,
_T("This program uses Unicode and requires Windows NT/2000/XP/CE.\nProgram aborted."),
- _T("wxWindows Fatal Error"),
+ _T("wxWidgets Fatal Error"),
MB_ICONERROR | MB_OK
);
wxDisableButtonBrush = ::CreateBrushIndirect( & lb );
::DeleteObject( (HGDIOBJ)lb.lbHatch );
}
- //else: wxWindows resources are probably not linked in
+ //else: wxWidgets resources are probably not linked in
#endif
#if wxUSE_PENWINDOWS
delete wxWinHandleHash;
wxWinHandleHash = NULL;
+
+#ifdef __WXWINCE__
+ free( wxCanvasClassName );
+ free( wxCanvasClassNameNR );
+#endif
}
// ----------------------------------------------------------------------------
delete [] argv;
}
+// ----------------------------------------------------------------------------
+// wxApp idle handling
+// ----------------------------------------------------------------------------
+
void wxApp::OnIdle(wxIdleEvent& event)
{
wxAppBase::OnIdle(event);
}
}
+// ----------------------------------------------------------------------------
+// other wxApp event hanlders
+// ----------------------------------------------------------------------------
+
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
{
if (GetTopWindow())
}
}
+// ----------------------------------------------------------------------------
+// miscellaneous
+// ----------------------------------------------------------------------------
+
/* static */
int wxApp::GetComCtl32Version()
{
return TRUE;
}
+#if wxUSE_EXCEPTIONS
+
+// ----------------------------------------------------------------------------
+// exception handling
+// ----------------------------------------------------------------------------
+
+bool wxApp::OnExceptionInMainLoop()
+{
+ // ask the user about what to do: use the Win32 API function here as it
+ // could be dangerous to use any wxWidgets code in this state
+ switch (
+ ::MessageBox
+ (
+ NULL,
+ _T("An unhandled exception occurred. Press \"Abort\" to \
+terminate the program,\r\n\
+\"Retry\" to exit the program normally and \"Ignore\" to try to continue."),
+ _T("Unhandled exception"),
+ MB_ABORTRETRYIGNORE |
+ MB_ICONERROR|
+ MB_TASKMODAL
+ )
+ )
+ {
+ case IDABORT:
+ throw;
+
+ default:
+ wxFAIL_MSG( _T("unexpected MessageBox() return code") );
+ // fall through
+
+ case IDRETRY:
+ return false;
+
+ case IDIGNORE:
+ return true;
+ }
+}
+
+#endif // wxUSE_EXCEPTIONS