+bool wxApp::RegisterWindowClasses( HAB vHab )
+{
+ ERRORID vError = 0L;
+ wxString sError;
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxFrameClassName
+ ,wxFrameWndProc
+ ,CS_SIZEREDRAW | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxFrameClassNameNoRedraw
+ ,wxWndProc
+ ,0
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxMDIFrameClassName
+ ,wxWndProc
+ ,CS_SIZEREDRAW | CS_MOVENOTIFY | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxMDIFrameClassNameNoRedraw
+ ,wxWndProc
+ ,0
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxMDIChildFrameClassName
+ ,wxWndProc
+ ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_SYNCPAINT | CS_HITTEST
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxMDIChildFrameClassNameNoRedraw
+ ,wxWndProc
+ ,CS_HITTEST
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxPanelClassName
+ ,wxWndProc
+ ,CS_MOVENOTIFY | CS_SIZEREDRAW | CS_HITTEST | CS_SAVEBITS | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxCanvasClassName
+ ,wxWndProc
+ ,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+ if (!::WinRegisterClass( vHab
+ ,(PSZ)wxCanvasClassNameNR
+ ,wxWndProc
+ ,CS_HITTEST | CS_SYNCPAINT
+ ,sizeof(ULONG)
+ ))
+ {
+ vError = ::WinGetLastError(vHab);
+ sError = wxPMErrorToStr(vError);
+ wxLogLastError(sError.c_str());
+ return false;
+ }
+ return true;
+} // end of wxApp::RegisterWindowClasses
+
+//
+// Cleans up any wxWidgets internal structures left lying around
+//
+void wxApp::CleanUp()
+{
+ delete[] wxBuffer;
+ wxBuffer = NULL;
+
+ //
+ // PM-SPECIFIC CLEANUP
+ //
+
+ // wxSetKeyboardHook(false);
+
+ if (wxSTD_FRAME_ICON)
+ ::WinFreeFileIcon(wxSTD_FRAME_ICON);
+ if (wxSTD_MDICHILDFRAME_ICON)
+ ::WinFreeFileIcon(wxSTD_MDICHILDFRAME_ICON);
+ if (wxSTD_MDIPARENTFRAME_ICON)
+ ::WinFreeFileIcon(wxSTD_MDIPARENTFRAME_ICON);
+
+ if (wxDEFAULT_FRAME_ICON)
+ ::WinFreeFileIcon(wxDEFAULT_FRAME_ICON);
+ if (wxDEFAULT_MDICHILDFRAME_ICON)
+ ::WinFreeFileIcon(wxDEFAULT_MDICHILDFRAME_ICON);
+ if (wxDEFAULT_MDIPARENTFRAME_ICON)
+ ::WinFreeFileIcon(wxDEFAULT_MDIPARENTFRAME_ICON);
+
+ if ( wxDisableButtonBrush )
+ {
+// TODO: ::DeleteObject( wxDisableButtonBrush );
+ }