1 /////////////////////////////////////////////////////////////////////////////
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/gdicmn.h"
22 #include "wx/cursor.h"
24 #include "wx/palette.h"
26 #include "wx/dialog.h"
27 #include "wx/msgdlg.h"
29 #include "wx/dynarray.h"
30 #include "wx/wxchar.h"
36 #include "wx/module.h"
38 #include "wx/os2/private.h"
41 #include "wx/thread.h"
43 // define the array of QMSG strutures
44 WX_DECLARE_OBJARRAY(QMSG
, wxMsgArray
);
46 #include "wx/arrimpl.cpp"
48 WX_DEFINE_OBJARRAY(wxMsgArray
);
49 #endif // wxUSE_THREADS
51 #if wxUSE_WX_RESOURCES
52 #include "wx/resource.h"
56 #include "wx/tooltip.h"
57 #endif // wxUSE_TOOLTIPS
62 // ---------------------------------------------------------------------------
64 // ---------------------------------------------------------------------------
66 extern wxChar
* wxBuffer
;
67 extern wxList
* wxWinHandleList
;
68 extern wxList WXDLLEXPORT wxPendingDelete
;
69 extern wxCursor
* g_globalCursor
;
71 HAB vHabmain
= NULLHANDLE
;
73 wxApp
* wxTheApp
= NULL
;
75 // NB: all "NoRedraw" classes must have the same names as the "normal" classes
76 // with NR suffix - wxWindow::OS2Create() supposes this
77 wxChar wxFrameClassName
[] = wxT("wxFrameClass");
78 wxChar wxFrameClassNameNoRedraw
[] = wxT("wxFrameClassNR");
79 wxChar wxMDIFrameClassName
[] = wxT("wxMDIFrameClass");
80 wxChar wxMDIFrameClassNameNoRedraw
[] = wxT("wxMDIFrameClassNR");
81 wxChar wxMDIChildFrameClassName
[] = wxT("wxMDIChildFrameClass");
82 wxChar wxMDIChildFrameClassNameNoRedraw
[] = wxT("wxMDIChildFrameClassNR");
83 wxChar wxPanelClassName
[] = wxT("wxPanelClass");
84 wxChar wxCanvasClassName
[] = wxT("wxCanvasClass");
86 HICON wxSTD_FRAME_ICON
= (HICON
) NULL
;
87 HICON wxSTD_MDICHILDFRAME_ICON
= (HICON
) NULL
;
88 HICON wxSTD_MDIPARENTFRAME_ICON
= (HICON
) NULL
;
90 HICON wxDEFAULT_FRAME_ICON
= (HICON
) NULL
;
91 HICON wxDEFAULT_MDICHILDFRAME_ICON
= (HICON
) NULL
;
92 HICON wxDEFAULT_MDIPARENTFRAME_ICON
= (HICON
) NULL
;
94 HBRUSH wxDisableButtonBrush
= (HBRUSH
) 0;
96 MRESULT EXPENTRY
wxWndProc( HWND hWnd
,ULONG message
,MPARAM mp1
,MPARAM mp2
);
97 MRESULT EXPENTRY
wxFrameWndProc( HWND hWnd
,ULONG message
,MPARAM mp1
,MPARAM mp2
);
99 // ===========================================================================
101 // ===========================================================================
103 // ---------------------------------------------------------------------------
105 // ---------------------------------------------------------------------------
107 IMPLEMENT_DYNAMIC_CLASS(wxApp
, wxEvtHandler
)
109 BEGIN_EVENT_TABLE(wxApp
, wxEvtHandler
)
110 EVT_IDLE(wxApp::OnIdle
)
111 EVT_END_SESSION(wxApp::OnEndSession
)
112 EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession
)
118 bool wxApp::Initialize(
122 #if defined(wxUSE_CONSOLEDEBUG)
123 #if wxUSE_CONSOLEDEBUG
124 /***********************************************/
125 /* Code for using stdout debug */
126 /* To use it you mast link app as "Window" - EK*/
127 /***********************************************/
132 printf("In console\n");
134 DosGetInfoBlocks(&tib
, &pib
);
135 /* Try morphing into a PM application. */
136 // if(pib->pib_ultype == 2) /* VIO */
139 /**********************************************/
140 /**********************************************/
141 #endif //wxUSE_CONSOLEDEBUG
145 // OS2 has to have an anchorblock
147 vHab
= WinInitialize(0);
154 // Some people may wish to use this, but
155 // probably it shouldn't be here by default.
157 // wxRedirectIOToConsole();
160 wxBuffer
= new wxChar
[1500]; // FIXME; why?
162 wxClassInfo::InitializeClasses();
165 wxPendingEventsLocker
= new wxCriticalSection
;
168 wxTheColourDatabase
= new wxColourDatabase(wxKEY_STRING
);
169 wxTheColourDatabase
->Initialize();
171 wxInitializeStockLists();
172 wxInitializeStockObjects();
174 #if wxUSE_WX_RESOURCES
175 wxInitializeResourceSystem();
178 wxBitmap::InitStandardHandlers();
180 RegisterWindowClasses(vHab
);
181 wxWinHandleList
= new wxList(wxKEY_INTEGER
);
183 // This is to foil optimizations in Visual C++ that throw out dummy.obj.
184 // PLEASE DO NOT ALTER THIS.
185 #if !defined(WXMAKINGDLL) && defined(__VISAGECPP__)
186 extern char wxDummyChar
;
187 if (wxDummyChar
) wxDummyChar
++;
190 // wxSetKeyboardHook(TRUE);
192 wxModule::RegisterModules();
193 if (!wxModule::InitializeModules())
196 } // end of wxApp::Initialize
198 const char* CANTREGISTERCLASS
= " Can't register Class ";
199 // ---------------------------------------------------------------------------
200 // RegisterWindowClasses
201 // ---------------------------------------------------------------------------
203 bool wxApp::RegisterWindowClasses(
211 if (!::WinRegisterClass( vHab
214 ,CS_SIZEREDRAW
| CS_MOVENOTIFY
| CS_SYNCPAINT
| CS_CLIPCHILDREN
218 vError
= ::WinGetLastError(vHab
);
219 sError
= wxPMErrorToStr(vError
);
220 wxLogLastError(sError
);
224 if (!::WinRegisterClass( vHab
225 ,wxFrameClassNameNoRedraw
231 vError
= ::WinGetLastError(vHab
);
232 sError
= wxPMErrorToStr(vError
);
233 wxLogLastError(sError
);
237 if (!::WinRegisterClass( vHab
240 ,CS_SIZEREDRAW
| CS_MOVENOTIFY
| CS_SYNCPAINT
244 vError
= ::WinGetLastError(vHab
);
245 sError
= wxPMErrorToStr(vError
);
246 wxLogLastError(sError
);
250 if (!::WinRegisterClass( vHab
251 ,wxMDIFrameClassNameNoRedraw
257 vError
= ::WinGetLastError(vHab
);
258 sError
= wxPMErrorToStr(vError
);
259 wxLogLastError(sError
);
263 if (!::WinRegisterClass( vHab
264 ,wxMDIChildFrameClassName
266 ,CS_MOVENOTIFY
| CS_SIZEREDRAW
| CS_SYNCPAINT
| CS_HITTEST
270 vError
= ::WinGetLastError(vHab
);
271 sError
= wxPMErrorToStr(vError
);
272 wxLogLastError(sError
);
276 if (!::WinRegisterClass( vHab
277 ,wxMDIChildFrameClassNameNoRedraw
283 vError
= ::WinGetLastError(vHab
);
284 sError
= wxPMErrorToStr(vError
);
285 wxLogLastError(sError
);
289 if (!::WinRegisterClass( vHab
292 ,CS_MOVENOTIFY
| CS_SIZEREDRAW
| CS_HITTEST
| CS_SAVEBITS
| CS_SYNCPAINT
296 vError
= ::WinGetLastError(vHab
);
297 sError
= wxPMErrorToStr(vError
);
298 wxLogLastError(sError
);
302 if (!::WinRegisterClass( vHab
305 ,CS_MOVENOTIFY
| CS_SIZEREDRAW
| CS_HITTEST
| CS_SAVEBITS
| CS_SYNCPAINT
| CS_CLIPCHILDREN
309 vError
= ::WinGetLastError(vHab
);
310 sError
= wxPMErrorToStr(vError
);
311 wxLogLastError(sError
);
315 } // end of wxApp::RegisterWindowClasses
318 // Cleans up any wxWindows internal structures left lying around
320 void wxApp::CleanUp()
329 // Flush the logged messages if any and install a 'safer' log target: the
330 // default one (wxLogGui) can't be used after the resources are freed just
331 // below and the user suppliedo ne might be even more unsafe (using any
332 // wxWindows GUI function is unsafe starting from now)
334 wxLog::DontCreateOnDemand();
337 // This will flush the old messages if any
339 delete wxLog::SetActiveTarget(new wxLogStderr
);
343 // One last chance for pending objects to be cleaned up
345 wxTheApp
->DeletePendingObjects();
347 wxModule::CleanUpModules();
349 #if wxUSE_WX_RESOURCES
350 wxCleanUpResourceSystem();
353 wxDeleteStockObjects();
356 // Destroy all GDI lists, etc.
358 wxDeleteStockLists();
360 delete wxTheColourDatabase
;
361 wxTheColourDatabase
= NULL
;
363 wxBitmap::CleanUpHandlers();
369 // PM-SPECIFIC CLEANUP
372 // wxSetKeyboardHook(FALSE);
374 if (wxSTD_FRAME_ICON
)
375 ::WinFreeFileIcon(wxSTD_FRAME_ICON
);
376 if (wxSTD_MDICHILDFRAME_ICON
)
377 ::WinFreeFileIcon(wxSTD_MDICHILDFRAME_ICON
);
378 if (wxSTD_MDIPARENTFRAME_ICON
)
379 ::WinFreeFileIcon(wxSTD_MDIPARENTFRAME_ICON
);
381 if (wxDEFAULT_FRAME_ICON
)
382 ::WinFreeFileIcon(wxDEFAULT_FRAME_ICON
);
383 if (wxDEFAULT_MDICHILDFRAME_ICON
)
384 ::WinFreeFileIcon(wxDEFAULT_MDICHILDFRAME_ICON
);
385 if (wxDEFAULT_MDIPARENTFRAME_ICON
)
386 ::WinFreeFileIcon(wxDEFAULT_MDIPARENTFRAME_ICON
);
388 if ( wxDisableButtonBrush
)
390 // TODO: ::DeleteObject( wxDisableButtonBrush );
394 delete wxWinHandleList
;
396 delete wxPendingEvents
;
398 delete wxPendingEventsLocker
;
399 // If we don't do the following, we get an apparent memory leak.
400 ((wxEvtHandler
&) wxDefaultValidator
).ClearEventLocker();
403 wxClassInfo::CleanUpClasses();
405 // Delete Message queue
407 ::WinDestroyMsgQueue(wxTheApp
->m_hMq
);
412 #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
413 // At this point we want to check if there are any memory
414 // blocks that aren't part of the wxDebugContext itself,
415 // as a special case. Then when dumping we need to ignore
416 // wxDebugContext, too.
417 if (wxDebugContext::CountObjectsLeft(TRUE
) > 0)
419 wxLogDebug(wxT("There were memory leaks."));
420 wxDebugContext::Dump();
421 wxDebugContext::PrintStatistics();
423 // wxDebugContext::SetStream(NULL, NULL);
427 // do it as the very last thing because everything else can log messages
428 delete wxLog::SetActiveTarget(NULL
);
430 } // end of wxApp::CleanUp
432 //----------------------------------------------------------------------
433 // Main wxWindows entry point
434 //----------------------------------------------------------------------
442 if (!wxApp::Initialize(vHab
))
446 // create the application object or ensure that one already exists
450 // The app may have declared a global application object, but we recommend
451 // the IMPLEMENT_APP macro is used instead, which sets an initializer
452 // function for delayed, dynamic app object construction.
453 wxCHECK_MSG( wxApp::GetInitializerFunction(), 0,
454 wxT("No initializer - use IMPLEMENT_APP macro.") );
455 wxTheApp
= (*wxApp::GetInitializerFunction()) ();
457 wxCHECK_MSG( wxTheApp
, 0, wxT("You have to define an instance of wxApp!") );
458 wxTheApp
->argc
= argc
;
461 wxTheApp
->argv
= new wxChar
*[argc
+1];
467 wxTheApp
->argv
[nArgc
] = wxStrdup(wxConvLibc
.cMB2WX(argv
[nArgc
]));
470 wxTheApp
->argv
[nArgc
] = (wxChar
*)NULL
;
472 wxTheApp
->argv
= argv
;
475 wxString
sName(wxFileNameFromPath(argv
[0]));
477 wxStripExtension(sName
);
478 wxTheApp
->SetAppName(sName
);
482 if (!wxTheApp
->OnInitGui())
487 if (wxTheApp
->OnInit())
489 nRetValue
= wxTheApp
->OnRun();
492 wxWindow
* pTopWindow
= wxTheApp
->GetTopWindow();
495 // Forcibly delete the window.
496 if (pTopWindow
->IsKindOf(CLASSINFO(wxFrame
)) ||
497 pTopWindow
->IsKindOf(CLASSINFO(wxDialog
)) )
499 pTopWindow
->Close(TRUE
);
500 wxTheApp
->DeletePendingObjects();
505 wxTheApp
->SetTopWindow(NULL
);
509 else // app initialization failed
511 wxLogLastError(" Gui initialization failed, exitting");
513 #if wxUSE_CONSOLEDEBUG
514 printf("wxTheApp->OnExit ");
518 #if wxUSE_CONSOLEDEBUG
519 printf("wxApp::CleanUp ");
523 #if wxUSE_CONSOLEDEBUG
524 printf("return %i ", nRetValue
);
530 bool wxApp::OnInitGui()
535 m_hMq
= ::WinCreateMsgQueue(vHabmain
, 0);
538 vError
= ::WinGetLastError(vHabmain
);
539 sError
= wxPMErrorToStr(vError
);
544 } // end of wxApp::OnInitGui
547 // Static member initialization
549 wxAppInitializerFunction
wxAppBase::m_appInitFn
= (wxAppInitializerFunction
) NULL
;
555 m_wantDebugOutput
= TRUE
;
559 m_nPrintMode
= wxPRINT_WINDOWS
;
560 m_exitOnFrameDelete
= TRUE
;
563 } // end of wxApp::wxApp
568 // Delete command-line args
573 for (i
= 0; i
< argc
; i
++)
579 } // end of wxApp::~wxApp
581 bool wxApp::Initialized()
587 } // end of wxApp::Initialized
590 // Get and process a message, returning FALSE if WM_QUIT
591 // received (and also set the flag telling the app to exit the main loop)
593 bool wxApp::DoMessage()
595 BOOL bRc
= ::WinGetMsg(vHabmain
, &svCurrentMsg
, HWND(NULL
), 0, 0);
600 m_bKeepGoing
= FALSE
;
605 // should never happen, but let's test for it nevertheless
606 wxLogLastError("GetMessage");
611 wxASSERT_MSG( wxThread::IsMain()
612 ,wxT("only the main thread can process Windows messages")
615 static bool sbHadGuiLock
= TRUE
;
616 static wxMsgArray svSavedMessages
;
619 // If a secondary thread owns is doing GUI calls, save all messages for
620 // later processing - we can't process them right now because it will
621 // lead to recursive library calls (and we're not reentrant)
623 if (!wxGuiOwnedByMainThread())
625 sbHadGuiLock
= FALSE
;
628 // Leave out WM_COMMAND messages: too dangerous, sometimes
629 // the message will be processed twice
631 if ( !wxIsWaitingForThread() ||
632 svCurrentMsg
.msg
!= WM_COMMAND
)
634 svSavedMessages
.Add(svCurrentMsg
);
641 // Have we just regained the GUI lock? if so, post all of the saved
648 size_t nCount
= svSavedMessages
.Count();
650 for (size_t n
= 0; n
< nCount
; n
++)
652 QMSG vMsg
= svSavedMessages
[n
];
654 if ( !ProcessMessage((WXMSG
*)&vMsg
) )
656 ::WinDispatchMsg(vHabmain
, &vMsg
);
659 svSavedMessages
.Empty();
662 #endif // wxUSE_THREADS
664 // Process the message
665 if (!ProcessMessage((WXMSG
*)&svCurrentMsg
))
667 ::WinDispatchMsg(vHabmain
, (PQMSG
)&svCurrentMsg
);
671 } // end of wxApp::DoMessage
673 //////////////////////////////////////////////////////////////////////////////
675 // Keep trying to process messages until WM_QUIT
678 // If there are messages to be processed, they will all be
679 // processed and OnIdle will not be called.
680 // When there are no more messages, OnIdle is called.
681 // If OnIdle requests more time,
682 // it will be repeatedly called so long as there are no pending messages.
683 // A 'feature' of this is that once OnIdle has decided that no more processing
684 // is required, then it won't get processing time until further messages
685 // are processed (it'll sit in DoMessage).
687 //////////////////////////////////////////////////////////////////////////////
688 int wxApp::MainLoop()
695 wxMutexGuiLeaveOrEnter();
696 #endif // wxUSE_THREADS
697 while (/*Pending() &&*/ ProcessIdle())
703 return (int)svCurrentMsg
.mp1
;
704 } // end of wxApp::MainLoop
707 // Returns TRUE if more time is needed.
709 bool wxApp::ProcessIdle()
713 vEvent
.SetEventObject(this);
714 ProcessEvent(vEvent
);
715 return vEvent
.MoreRequested();
716 } // end of wxApp::ProcessIdle
718 void wxApp::ExitMainLoop()
720 m_bKeepGoing
= FALSE
;
723 bool wxApp::Pending()
725 return (::WinPeekMsg(vHabmain
, (PQMSG
)&svCurrentMsg
, (HWND
)NULL
, 0, 0, PM_NOREMOVE
) != 0);
728 void wxApp::Dispatch()
733 //////////////////////////////////////////////////////////////////////////////
735 // Give all windows a chance to preprocess
736 // the message. Some may have accelerator tables, or have
737 // MDI complications.
739 //////////////////////////////////////////////////////////////////////////////
740 bool wxApp::ProcessMessage(
744 QMSG
* pMsg
= (PQMSG
)pWxmsg
;
745 HWND hWnd
= pMsg
->hwnd
;
746 wxWindow
* pWndThis
= wxFindWinFromHandle((WXHWND
)hWnd
);
751 // We must relay WM_MOUSEMOVE events to the tooltip ctrl if we want it to
752 // popup the tooltip bubbles
754 if (pWndThis
&& (pMsg
->msg
== WM_MOUSEMOVE
))
756 wxToolTip
* pToolTip
= pWndThis
->GetToolTip();
759 pToolTip
->RelayEvent(pWxmsg
);
762 #endif // wxUSE_TOOLTIPS
765 // We must relay Timer events to wxTimer's processing function
767 if (pMsg
->msg
== WM_TIMER
)
768 wxTimerProc(NULL
, 0, (int)pMsg
->mp1
, 0);
771 // For some composite controls (like a combobox), wndThis might be NULL
772 // because the subcontrol is not a wxWindow, but only the control itself
773 // is - try to catch this case
775 while (hWnd
&& !pWndThis
)
777 hWnd
= ::WinQueryWindow(hWnd
, QW_PARENT
);
778 pWndThis
= wxFindWinFromHandle((WXHWND
)hWnd
);
782 // Try translations first; find the youngest window with
783 // a translation table. OS/2 has case sensative accels, so
784 // this block, coded by BK, removes that and helps make them
787 if(pMsg
->msg
== WM_CHAR
)
789 PBYTE pChmsg
= (PBYTE
)&(pMsg
->msg
);
790 USHORT uSch
= CHARMSG(pChmsg
)->chr
;
794 // Do not process keyup events
796 if(!(CHARMSG(pChmsg
)->fs
& KC_KEYUP
))
798 if((CHARMSG(pChmsg
)->fs
& (KC_ALT
| KC_CTRL
)) && CHARMSG(pChmsg
)->chr
!= 0)
799 CHARMSG(pChmsg
)->chr
= (USHORT
)wxToupper((UCHAR
)uSch
);
802 for(pWnd
= pWndThis
; pWnd
; pWnd
= pWnd
->GetParent() )
804 if((bRc
= pWnd
->OS2TranslateMessage(pWxmsg
)) == TRUE
)
808 if(!bRc
) // untranslated, should restore original value
809 CHARMSG(pChmsg
)->chr
= uSch
;
813 // Anyone for a non-translation message? Try youngest descendants first.
815 // for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent())
817 // if (pWnd->OS2ProcessMessage(pWxmsg))
821 } // end of wxApp::ProcessMessage
827 static bool sbInOnIdle
= FALSE
;
830 // Avoid recursion (via ProcessEvent default case)
838 // If there are pending events, we must process them: pending events
839 // are either events to the threads other than main or events posted
840 // with wxPostEvent() functions
842 ProcessPendingEvents();
845 // 'Garbage' collection of windows deleted with Close().
847 DeletePendingObjects();
851 // Flush the logged messages if any
853 wxLog::FlushActive();
857 // Send OnIdle events to all windows
859 if (SendIdleEvents())
862 // SendIdleEvents() returns TRUE if at least one window requested more
865 rEvent
.RequestMore(TRUE
);
868 } // end of wxApp::OnIdle
870 // Send idle event to all top-level windows
871 bool wxApp::SendIdleEvents()
873 bool bNeedMore
= FALSE
;
874 wxWindowList::Node
* pNode
= wxTopLevelWindows
.GetFirst();
878 wxWindow
* pWin
= pNode
->GetData();
880 if (SendIdleEvents(pWin
))
882 pNode
= pNode
->GetNext();
885 } // end of wxApp::SendIdleEvents
888 // Send idle event to window and all subwindows
890 bool wxApp::SendIdleEvents(
894 bool bNeedMore
= FALSE
;
897 vEvent
.SetEventObject(pWin
);
898 pWin
->GetEventHandler()->ProcessEvent(vEvent
);
900 if (vEvent
.MoreRequested())
903 wxNode
* pNode
= pWin
->GetChildren().First();
907 wxWindow
* pWin
= (wxWindow
*) pNode
->Data();
909 if (SendIdleEvents(pWin
))
911 pNode
= pNode
->Next();
914 } // end of wxApp::SendIdleEvents
916 void wxApp::DeletePendingObjects()
918 wxNode
* pNode
= wxPendingDelete
.First();
922 wxObject
* pObj
= (wxObject
*)pNode
->Data();
926 if (wxPendingDelete
.Member(pObj
))
930 // Deleting one object may have deleted other pending
931 // objects, so start from beginning of list again.
933 pNode
= wxPendingDelete
.First();
935 } // end of wxApp::DeletePendingObjects
937 void wxApp::OnEndSession(
938 wxCloseEvent
& WXUNUSED(rEvent
))
941 GetTopWindow()->Close(TRUE
);
942 } // end of wxApp::OnEndSession
945 // Default behaviour: close the application with prompts. The
946 // user can veto the close, and therefore the end session.
948 void wxApp::OnQueryEndSession(
954 if (!GetTopWindow()->Close(!rEvent
.CanVeto()))
957 } // end of wxApp::OnQueryEndSession
961 wxLogError(_("Fatal error: exiting"));
966 static bool gs_inYield
= FALSE
;
969 // Yield to incoming messages
977 // Disable log flushing from here because a call to wxYield() shouldn't
978 // normally result in message boxes popping up &c
985 // We want to go back to the main message loop
986 // if we see a WM_QUIT. (?)
988 while (::WinPeekMsg(vHab
, &vMsg
, (HWND
)NULL
, 0, 0, PM_NOREMOVE
) && vMsg
.msg
!= WM_QUIT
)
991 wxMutexGuiLeaveOrEnter();
992 #endif // wxUSE_THREADS
993 if (!wxTheApp
->DoMessage())
997 // If they are pending events, we must process them.
1000 wxTheApp
->ProcessPendingEvents();
1003 // Let the logs be flashed again
1010 // Yield to incoming messages; but fail silently if recursion is detected.
1011 bool wxYieldIfNeeded()
1019 wxIcon
wxApp::GetStdIcon(
1025 case wxICON_INFORMATION
:
1026 return wxIcon("wxICON_INFO");
1028 case wxICON_QUESTION
:
1029 return wxIcon("wxICON_QUESTION");
1031 case wxICON_EXCLAMATION
:
1032 return wxIcon("wxICON_WARNING");
1035 wxFAIL_MSG(wxT("requested non existent standard icon"));
1036 // still fall through
1039 return wxIcon("wxICON_ERROR");
1041 return wxIcon("wxICON_ERROR");
1042 } // end of wxApp::GetStdIcon
1044 //-----------------------------------------------------------------------------
1046 //-----------------------------------------------------------------------------
1051 // Send the top window a dummy message so idle handler processing will
1052 // start up again. Doing it this way ensures that the idle handler
1053 // wakes up in the right thread (see also wxWakeUpMainThread() which does
1054 // the same for the main app thread only)
1056 wxWindow
* pTopWindow
= wxTheApp
->GetTopWindow();
1060 if ( !::WinPostMsg(GetHwndOf(pTopWindow
), WM_NULL
, (MPARAM
)0, (MPARAM
)0))
1063 // Should never happen
1065 wxLogLastError("PostMessage(WM_NULL)");
1068 } // end of wxWakeUpIdle