- // 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
-#if wxUSE_UNICODE && !wxUSE_UNICODE_MSLU
- if ( wxGetOsVersion() != wxWINDOWS_NT )
- {
- // note that we can use MessageBoxW() as it's implemented even under
- // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs
- // used by wxLocale are not
- ::MessageBox
- (
- NULL,
- _T("This program uses Unicode and requires Windows NT/2000/XP.\nProgram aborted."),
- _T("wxWindows Fatal Error"),
- MB_ICONERROR | MB_OK
- );
-
- return FALSE;
- }
-#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU
-
- wxBuffer = new wxChar[1500]; // FIXME
-
- wxClassInfo::InitializeClasses();
-
-#if wxUSE_THREADS
- wxPendingEventsLocker = new wxCriticalSection;
-#endif
-
- wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
- wxTheColourDatabase->Initialize();
-
- wxInitializeStockLists();
- wxInitializeStockObjects();
-
- wxBitmap::InitStandardHandlers();
-
-#if defined(__WIN95__) && !defined(__WXMICROWIN__)
- InitCommonControls();
-#endif // __WIN95__
-
-#if wxUSE_OLE || wxUSE_DRAG_AND_DROP
-
-#ifdef __WIN16__
- // for OLE, enlarge message queue to be as large as possible
- int iMsg = 96;
- while (!SetMessageQueue(iMsg) && (iMsg -= 8))
- ;
-#endif // Win16
-
-#if wxUSE_OLE
- // we need to initialize OLE library
- if ( FAILED(::OleInitialize(NULL)) )
- wxLogError(_("Cannot initialize OLE"));
-#endif
-
-#endif // wxUSE_OLE
-
-#if wxUSE_CTL3D
- if (!Ctl3dRegister(wxhInstance))
- wxLogError(wxT("Cannot register CTL3D"));
-
- Ctl3dAutoSubclass(wxhInstance);
-#endif // wxUSE_CTL3D
-
- // VZ: these icons are not in wx.rc anyhow (but should they?)!
-#if 0
- wxSTD_FRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_FRAME"));
- wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_MDIPARENTFRAME"));
- wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_MDICHILDFRAME"));
-
- wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_FRAME"));
- wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_MDIPARENTFRAME"));
- wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, wxT("wxDEFAULT_MDICHILDFRAME"));
-#endif // 0
-
- RegisterWindowClasses();
-
-#ifndef __WXMICROWIN__
- // Create the brush for disabling bitmap buttons
-
- LOGBRUSH lb;
- lb.lbStyle = BS_PATTERN;
- lb.lbColor = 0;
- lb.lbHatch = (int)LoadBitmap( wxhInstance, wxT("wxDISABLE_BUTTON_BITMAP") );
- if ( lb.lbHatch )