+#include <ctype.h>
+
+// ---------------------------------------------------------------------------
+// global variables
+// ---------------------------------------------------------------------------
+
+extern wxChar* wxBuffer;
+extern wxChar* wxOsVersion;
+extern wxList* wxWinHandleList;
+extern wxList WXDLLEXPORT wxPendingDelete;
+extern void wxSetKeyboardHook(bool doIt);
+extern wxCursor* g_globalCursor;
+
+HINSTANCE wxhInstance = 0;
+QMSG svCurrentMsg;
+wxApp* wxTheApp = NULL;
+HAB vHabmain = NULL;
+
+// FIXME why not const? and not static?
+
+// NB: all "NoRedraw" classes must have the same names as the "normal" classes
+// with NR suffix - wxWindow::OS2Create() supposes this
+wxChar wxFrameClassName[] = wxT("wxFrameClass");
+wxChar wxFrameClassNameNoRedraw[] = wxT("wxFrameClassNR");
+wxChar wxMDIFrameClassName[] = wxT("wxMDIFrameClass");
+wxChar wxMDIFrameClassNameNoRedraw[] = wxT("wxMDIFrameClassNR");
+wxChar wxMDIChildFrameClassName[] = wxT("wxMDIChildFrameClass");
+wxChar wxMDIChildFrameClassNameNoRedraw[] = wxT("wxMDIChildFrameClassNR");
+wxChar wxPanelClassName[] = wxT("wxPanelClass");
+wxChar wxCanvasClassName[] = wxT("wxCanvasClass");
+
+HICON wxSTD_FRAME_ICON = (HICON) NULL;
+HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL;
+HICON wxSTD_MDIPARENTFRAME_ICON = (HICON) NULL;
+
+HICON wxDEFAULT_FRAME_ICON = (HICON) NULL;
+HICON wxDEFAULT_MDICHILDFRAME_ICON = (HICON) NULL;
+HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL;
+
+HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
+
+MRESULT wxWndProc( HWND
+ ,ULONG
+ ,MPARAM
+ ,MPARAM
+ );
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// wxApp
+// ---------------------------------------------------------------------------
+
+ IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
+
+ BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
+ EVT_IDLE(wxApp::OnIdle)
+ EVT_END_SESSION(wxApp::OnEndSession)
+ EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
+ END_EVENT_TABLE()
+
+//// Initialize
+bool wxApp::Initialize(
+ HAB vHab
+)
+{
+ // Some people may wish to use this, but
+ // probably it shouldn't be here by default.
+#ifdef __WXDEBUG__
+ // wxRedirectIOToConsole();
+#endif