+ if (!vHab)
+ return FALSE;
+ else
+ vHabmain = vHab;
+
+ // Some people may wish to use this, but
+ // probably it shouldn't be here by default.
+#ifdef __WXDEBUG__
+ // wxRedirectIOToConsole();
+#endif
+
+ wxWinHandleList = new wxList(wxKEY_INTEGER);
+
+ // This is to foil optimizations in Visual C++ that throw out dummy.obj.
+ // PLEASE DO NOT ALTER THIS.
+#if !defined(WXMAKINGDLL) && defined(__VISAGECPP__)
+ extern char wxDummyChar;
+ if (wxDummyChar) wxDummyChar++;
+#endif
+
+ // wxSetKeyboardHook(TRUE);
+
+ wxModule::RegisterModules();
+ if (!wxModule::InitializeModules())
+ return FALSE;
+ RegisterWindowClasses(vHab);
+ return TRUE;
+} // end of wxApp::Initialize
+
+const char* CANTREGISTERCLASS = " Can't register Class ";
+// ---------------------------------------------------------------------------
+// RegisterWindowClasses
+// ---------------------------------------------------------------------------
+
+bool wxApp::RegisterWindowClasses(
+ HAB vHab
+)
+{
+ ERRORID vError = 0L;
+ wxString sError;
+
+ if (!::WinRegisterClass( vHab
+ ,wxFrameClassName
+ ,wxFrameWndProc
+ ,CS_SIZEREDRAW | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxFrameClassNameNoRedraw
+ ,wxWndProc
+ ,0
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxMDIFrameClassName
+ ,wxWndProc
+ ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxMDIFrameClassNameNoRedraw
+ ,wxWndProc
+ ,0
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxMDIChildFrameClassName
+ ,wxWndProc
+ ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxMDIChildFrameClassNameNoRedraw
+ ,wxWndProc
+ ,CS_HITTEST
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxPanelClassName
+ ,wxWndProc
+ ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,wxCanvasClassName
+ ,wxWndProc
+ ,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+ if (!::WinRegisterClass( vHab
+ ,wxCanvasClassNameNR
+ ,wxWndProc
+ ,CS_HITTEST | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError);
+ return FALSE;
+ }
+ return TRUE;
+} // end of wxApp::RegisterWindowClasses