1 /////////////////////////////////////////////////////////////////////////////
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "app.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
23 #include "wx/gdicmn.h"
26 #include "wx/cursor.h"
28 #include "wx/palette.h"
30 #include "wx/dialog.h"
31 #include "wx/msgdlg.h"
33 #include "wx/dynarray.h"
34 #include "wx/wxchar.h"
40 #include "wx/module.h"
42 #include "wx/os2/private.h"
46 #include <sys/ioctl.h>
47 #include <sys/select.h>
52 #include <sys/ioctl.h>
53 #include <sys/select.h>
60 #define select(a,b,c,d,e) bsdselect(a,b,c,d,e)
61 extern "C" int _System
bsdselect(int,
69 #include "wx/thread.h"
71 // define the array of QMSG strutures
72 WX_DECLARE_OBJARRAY(QMSG
, wxMsgArray
);
74 #include "wx/arrimpl.cpp"
76 WX_DEFINE_OBJARRAY(wxMsgArray
);
77 #endif // wxUSE_THREADS
80 #include "wx/tooltip.h"
81 #endif // wxUSE_TOOLTIPS
86 // ---------------------------------------------------------------------------
88 // ---------------------------------------------------------------------------
90 extern wxChar
* wxBuffer
;
91 extern wxList
* wxWinHandleList
;
92 extern wxList WXDLLEXPORT wxPendingDelete
;
93 extern wxCursor
* g_globalCursor
;
95 HAB vHabmain
= NULLHANDLE
;
99 HICON wxSTD_FRAME_ICON
= (HICON
) NULL
;
100 HICON wxSTD_MDICHILDFRAME_ICON
= (HICON
) NULL
;
101 HICON wxSTD_MDIPARENTFRAME_ICON
= (HICON
) NULL
;
103 HICON wxDEFAULT_FRAME_ICON
= (HICON
) NULL
;
104 HICON wxDEFAULT_MDICHILDFRAME_ICON
= (HICON
) NULL
;
105 HICON wxDEFAULT_MDIPARENTFRAME_ICON
= (HICON
) NULL
;
107 HBRUSH wxDisableButtonBrush
= (HBRUSH
) 0;
109 MRESULT EXPENTRY
wxWndProc( HWND hWnd
,ULONG message
,MPARAM mp1
,MPARAM mp2
);
110 MRESULT EXPENTRY
wxFrameWndProc( HWND hWnd
,ULONG message
,MPARAM mp1
,MPARAM mp2
);
112 // ===========================================================================
114 // ===========================================================================
116 // ---------------------------------------------------------------------------
117 // helper struct and functions for socket handling
118 // ---------------------------------------------------------------------------
120 struct GsocketCallbackInfo
{
121 void (*proc
)(void *);
127 // These defines and wrapper functions are used here and in gsockpm.c
128 #define wxSockReadMask 0x01
129 #define wxSockWriteMask 0x02
133 int wxAppAddSocketHandler(int handle
, int mask
,
134 void (*callback
)(void*), void * gsock
)
136 return wxTheApp
->AddSocketHandler(handle
, mask
, callback
, gsock
);
139 void wxAppRemoveSocketHandler(int handle
)
141 wxTheApp
->RemoveSocketHandler(handle
);
144 // Linkage mode problems using callbacks with extern C in a .cpp module
145 int wxAppAddSocketHandler(int handle
, int mask
,
146 void (*callback
)(void*), void * gsock
)
148 return wxTheApp
->AddSocketHandler(handle
, mask
, callback
, gsock
);
150 void wxAppRemoveSocketHandler(int handle
)
152 wxTheApp
->RemoveSocketHandler(handle
);
156 void wxApp::HandleSockets()
158 bool pendingEvent
= FALSE
;
160 // Check whether it's time for Gsocket operation
161 if (m_maxSocketHandles
> 0 && m_maxSocketNr
> 0)
163 fd_set readfds
= m_readfds
;
164 fd_set writefds
= m_writefds
;
165 struct timeval timeout
;
167 struct GsocketCallbackInfo
168 *CallbackInfo
= (struct GsocketCallbackInfo
*)m_sockCallbackInfo
;
172 if ( select(m_maxSocketNr
, &readfds
, &writefds
, 0, &timeout
) > 0)
174 for (i
= m_lastUsedHandle
+ 1; i
!= m_lastUsedHandle
; i
++)
176 if (i
== m_maxSocketNr
)
178 if (FD_ISSET(i
, &readfds
))
181 for (r
= 0; r
< m_maxSocketHandles
; r
++){
182 if(CallbackInfo
[r
].handle
== i
&&
183 CallbackInfo
[r
].type
== wxSockReadMask
)
186 if (r
< m_maxSocketHandles
)
188 CallbackInfo
[r
].proc(CallbackInfo
[r
].gsock
);
193 if (FD_ISSET(i
, &writefds
))
196 for (r
= 0; r
< m_maxSocketHandles
; r
++)
197 if(CallbackInfo
[r
].handle
== i
&&
198 CallbackInfo
[r
].type
== wxSockWriteMask
)
200 if (r
< m_maxSocketHandles
)
202 CallbackInfo
[r
].proc(CallbackInfo
[r
].gsock
);
208 m_lastUsedHandle
= i
;
214 // ---------------------------------------------------------------------------
216 // ---------------------------------------------------------------------------
218 IMPLEMENT_DYNAMIC_CLASS(wxApp
, wxEvtHandler
)
220 BEGIN_EVENT_TABLE(wxApp
, wxEvtHandler
)
221 EVT_IDLE(wxApp::OnIdle
)
222 EVT_END_SESSION(wxApp::OnEndSession
)
223 EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession
)
229 bool wxApp::Initialize(int& argc
, wxChar
**argv
)
231 if ( !wxAppBase::Initialize(argc
, argv
) )
234 #if defined(wxUSE_CONSOLEDEBUG)
235 #if wxUSE_CONSOLEDEBUG
236 /***********************************************/
237 /* Code for using stdout debug */
238 /* To use it you mast link app as "Window" - EK*/
239 /***********************************************/
244 printf("In console\n");
246 DosGetInfoBlocks(&tib
, &pib
);
247 /* Try morphing into a PM application. */
248 // if(pib->pib_ultype == 2) /* VIO */
251 /**********************************************/
252 /**********************************************/
253 #endif //wxUSE_CONSOLEDEBUG
257 // OS2 has to have an anchorblock
259 vHabmain
= WinInitialize(0);
263 // TODO: at least give some error message here...
264 wxAppBase::CleanUp();
269 wxBuffer
= new wxChar
[1500]; // FIXME; why?
271 // Some people may wish to use this, but
272 // probably it shouldn't be here by default.
274 // wxRedirectIOToConsole();
277 wxWinHandleList
= new wxList(wxKEY_INTEGER
);
279 // This is to foil optimizations in Visual C++ that throw out dummy.obj.
280 // PLEASE DO NOT ALTER THIS.
281 #if !defined(WXMAKINGDLL) && defined(__VISAGECPP__)
282 extern char wxDummyChar
;
283 if (wxDummyChar
) wxDummyChar
++;
286 // wxSetKeyboardHook(TRUE);
288 RegisterWindowClasses(vHab
);
291 } // end of wxApp::Initialize
293 const char* CANTREGISTERCLASS
= " Can't register Class ";
294 // ---------------------------------------------------------------------------
295 // RegisterWindowClasses
296 // ---------------------------------------------------------------------------
298 bool wxApp::RegisterWindowClasses(
305 if (!::WinRegisterClass( vHab
308 ,CS_SIZEREDRAW
| CS_SYNCPAINT
312 vError
= ::WinGetLastError(vHab
);
313 sError
= wxPMErrorToStr(vError
);
314 wxLogLastError(sError
);
318 if (!::WinRegisterClass( vHab
319 ,wxFrameClassNameNoRedraw
325 vError
= ::WinGetLastError(vHab
);
326 sError
= wxPMErrorToStr(vError
);
327 wxLogLastError(sError
);
331 if (!::WinRegisterClass( vHab
334 ,CS_SIZEREDRAW
| CS_MOVENOTIFY
| CS_SYNCPAINT
338 vError
= ::WinGetLastError(vHab
);
339 sError
= wxPMErrorToStr(vError
);
340 wxLogLastError(sError
);
344 if (!::WinRegisterClass( vHab
345 ,wxMDIFrameClassNameNoRedraw
351 vError
= ::WinGetLastError(vHab
);
352 sError
= wxPMErrorToStr(vError
);
353 wxLogLastError(sError
);
357 if (!::WinRegisterClass( vHab
358 ,wxMDIChildFrameClassName
360 ,CS_MOVENOTIFY
| CS_SIZEREDRAW
| CS_SYNCPAINT
| CS_HITTEST
364 vError
= ::WinGetLastError(vHab
);
365 sError
= wxPMErrorToStr(vError
);
366 wxLogLastError(sError
);
370 if (!::WinRegisterClass( vHab
371 ,wxMDIChildFrameClassNameNoRedraw
377 vError
= ::WinGetLastError(vHab
);
378 sError
= wxPMErrorToStr(vError
);
379 wxLogLastError(sError
);
383 if (!::WinRegisterClass( vHab
386 ,CS_MOVENOTIFY
| CS_SIZEREDRAW
| CS_HITTEST
| CS_SAVEBITS
| CS_SYNCPAINT
390 vError
= ::WinGetLastError(vHab
);
391 sError
= wxPMErrorToStr(vError
);
392 wxLogLastError(sError
);
396 if (!::WinRegisterClass( vHab
399 ,CS_SIZEREDRAW
| CS_HITTEST
| CS_SYNCPAINT
403 vError
= ::WinGetLastError(vHab
);
404 sError
= wxPMErrorToStr(vError
);
405 wxLogLastError(sError
);
408 if (!::WinRegisterClass( vHab
411 ,CS_HITTEST
| CS_SYNCPAINT
415 vError
= ::WinGetLastError(vHab
);
416 sError
= wxPMErrorToStr(vError
);
417 wxLogLastError(sError
);
421 } // end of wxApp::RegisterWindowClasses
424 // Cleans up any wxWindows internal structures left lying around
426 void wxApp::CleanUp()
432 // PM-SPECIFIC CLEANUP
435 // wxSetKeyboardHook(FALSE);
437 if (wxSTD_FRAME_ICON
)
438 ::WinFreeFileIcon(wxSTD_FRAME_ICON
);
439 if (wxSTD_MDICHILDFRAME_ICON
)
440 ::WinFreeFileIcon(wxSTD_MDICHILDFRAME_ICON
);
441 if (wxSTD_MDIPARENTFRAME_ICON
)
442 ::WinFreeFileIcon(wxSTD_MDIPARENTFRAME_ICON
);
444 if (wxDEFAULT_FRAME_ICON
)
445 ::WinFreeFileIcon(wxDEFAULT_FRAME_ICON
);
446 if (wxDEFAULT_MDICHILDFRAME_ICON
)
447 ::WinFreeFileIcon(wxDEFAULT_MDICHILDFRAME_ICON
);
448 if (wxDEFAULT_MDIPARENTFRAME_ICON
)
449 ::WinFreeFileIcon(wxDEFAULT_MDIPARENTFRAME_ICON
);
451 if ( wxDisableButtonBrush
)
453 // TODO: ::DeleteObject( wxDisableButtonBrush );
457 delete wxWinHandleList
;
459 delete wxPendingEvents
;
461 delete wxPendingEventsLocker
;
462 // If we don't do the following, we get an apparent memory leak.
463 ((wxEvtHandler
&) wxDefaultValidator
).ClearEventLocker();
466 // Delete Message queue
468 ::WinDestroyMsgQueue(wxTheApp
->m_hMq
);
470 wxAppBase::CleanUp();
471 } // end of wxApp::CleanUp
473 bool wxApp::OnInitGui()
478 if (!wxAppBase::OnInitGui())
481 m_hMq
= ::WinCreateMsgQueue(vHabmain
, 0);
484 vError
= ::WinGetLastError(vHabmain
);
485 sError
= wxPMErrorToStr(vError
);
491 } // end of wxApp::OnInitGui
500 m_nPrintMode
= wxPRINT_WINDOWS
;
503 m_maxSocketHandles
= 0;
505 m_sockCallbackInfo
= 0;
506 } // end of wxApp::wxApp
511 // Delete command-line args
516 for (i
= 0; i
< argc
; i
++)
522 } // end of wxApp::~wxApp
524 bool wxApp::Initialized()
530 } // end of wxApp::Initialized
533 // Get and process a message, returning FALSE if WM_QUIT
534 // received (and also set the flag telling the app to exit the main loop)
537 bool wxApp::DoMessage()
539 BOOL bRc
= ::WinGetMsg(vHabmain
, &svCurrentMsg
, HWND(NULL
), 0, 0);
544 m_bKeepGoing
= FALSE
;
549 // should never happen, but let's test for it nevertheless
550 wxLogLastError("GetMessage");
555 wxASSERT_MSG( wxThread::IsMain()
556 ,wxT("only the main thread can process Windows messages")
559 static bool sbHadGuiLock
= TRUE
;
560 static wxMsgArray svSavedMessages
;
563 // If a secondary thread owns is doing GUI calls, save all messages for
564 // later processing - we can't process them right now because it will
565 // lead to recursive library calls (and we're not reentrant)
567 if (!wxGuiOwnedByMainThread())
569 sbHadGuiLock
= FALSE
;
572 // Leave out WM_COMMAND messages: too dangerous, sometimes
573 // the message will be processed twice
575 if ( !wxIsWaitingForThread() ||
576 svCurrentMsg
.msg
!= WM_COMMAND
)
578 svSavedMessages
.Add(svCurrentMsg
);
585 // Have we just regained the GUI lock? if so, post all of the saved
592 size_t nCount
= svSavedMessages
.Count();
594 for (size_t n
= 0; n
< nCount
; n
++)
596 QMSG vMsg
= svSavedMessages
[n
];
598 DoMessage((WXMSG
*)&vMsg
);
600 svSavedMessages
.Empty();
603 #endif // wxUSE_THREADS
606 // Process the message
608 DoMessage((WXMSG
*)&svCurrentMsg
);
611 } // end of wxApp::DoMessage
613 void wxApp::DoMessage(
617 if (!ProcessMessage((WXMSG
*)&svCurrentMsg
))
619 ::WinDispatchMsg(vHabmain
, (PQMSG
)&svCurrentMsg
);
621 } // end of wxApp::DoMessage
623 //////////////////////////////////////////////////////////////////////////////
625 // Keep trying to process messages until WM_QUIT
628 // If there are messages to be processed, they will all be
629 // processed and OnIdle will not be called.
630 // When there are no more messages, OnIdle is called.
631 // If OnIdle requests more time,
632 // it will be repeatedly called so long as there are no pending messages.
633 // A 'feature' of this is that once OnIdle has decided that no more processing
634 // is required, then it won't get processing time until further messages
635 // are processed (it'll sit in DoMessage).
637 //////////////////////////////////////////////////////////////////////////////
638 int wxApp::MainLoop()
645 wxMutexGuiLeaveOrEnter();
646 #endif // wxUSE_THREADS
647 while (!Pending() && ProcessIdle())
659 return (int)svCurrentMsg
.mp1
;
660 } // end of wxApp::MainLoop
663 // Returns TRUE if more time is needed.
665 bool wxApp::ProcessIdle()
669 vEvent
.SetEventObject(this);
670 ProcessEvent(vEvent
);
671 return vEvent
.MoreRequested();
672 } // end of wxApp::ProcessIdle
674 void wxApp::ExitMainLoop()
676 ::WinPostMsg(NULL
, WM_QUIT
, 0, 0);
677 } // end of wxApp::ExitMainLoop
679 bool wxApp::Pending()
681 return (::WinPeekMsg(vHabmain
, (PQMSG
)&svCurrentMsg
, (HWND
)NULL
, 0, 0, PM_NOREMOVE
) != 0);
682 } // end of wxApp::Pending
684 void wxApp::Dispatch()
689 //////////////////////////////////////////////////////////////////////////////
691 // Give all windows a chance to preprocess
692 // the message. Some may have accelerator tables, or have
693 // MDI complications.
695 //////////////////////////////////////////////////////////////////////////////
696 bool wxApp::ProcessMessage(
700 QMSG
* pMsg
= (PQMSG
)pWxmsg
;
701 HWND hWnd
= pMsg
->hwnd
;
702 wxWindow
* pWndThis
= wxFindWinFromHandle((WXHWND
)hWnd
);
706 // Pass non-system timer messages to the wxTimerProc
708 if (pMsg
->msg
== WM_TIMER
&&
709 (SHORT1FROMMP(pMsg
->mp1
) != TID_CURSOR
&&
710 SHORT1FROMMP(pMsg
->mp1
) != TID_FLASHWINDOW
&&
711 SHORT1FROMMP(pMsg
->mp1
) != TID_SCROLL
&&
712 SHORT1FROMMP(pMsg
->mp1
) != 0x0000
714 wxTimerProc(NULL
, 0, (int)pMsg
->mp1
, 0);
717 // Allow the window to prevent certain messages from being
718 // translated/processed (this is currently used by wxTextCtrl to always
719 // grab Ctrl-C/V/X, even if they are also accelerators in some parent)
721 if (pWndThis
&& !pWndThis
->OS2ShouldPreProcessMessage(pWxmsg
))
727 // For some composite controls (like a combobox), wndThis might be NULL
728 // because the subcontrol is not a wxWindow, but only the control itself
729 // is - try to catch this case
731 while (hWnd
&& !pWndThis
)
733 hWnd
= ::WinQueryWindow(hWnd
, QW_PARENT
);
734 pWndThis
= wxFindWinFromHandle((WXHWND
)hWnd
);
738 // Try translations first; find the youngest window with
739 // a translation table. OS/2 has case sensative accels, so
740 // this block, coded by BK, removes that and helps make them
743 if(pMsg
->msg
== WM_CHAR
)
745 PBYTE pChmsg
= (PBYTE
)&(pMsg
->msg
);
746 USHORT uSch
= CHARMSG(pChmsg
)->chr
;
750 // Do not process keyup events
752 if(!(CHARMSG(pChmsg
)->fs
& KC_KEYUP
))
754 if((CHARMSG(pChmsg
)->fs
& (KC_ALT
| KC_CTRL
)) && CHARMSG(pChmsg
)->chr
!= 0)
755 CHARMSG(pChmsg
)->chr
= (USHORT
)wxToupper((UCHAR
)uSch
);
758 for(pWnd
= pWndThis
; pWnd
; pWnd
= pWnd
->GetParent() )
760 if((bRc
= pWnd
->OS2TranslateMessage(pWxmsg
)) == TRUE
)
764 if(!bRc
) // untranslated, should restore original value
765 CHARMSG(pChmsg
)->chr
= uSch
;
769 // Anyone for a non-translation message? Try youngest descendants first.
771 // for (pWnd = pWndThis; pWnd; pWnd = pWnd->GetParent())
773 // if (pWnd->OS2ProcessMessage(pWxmsg))
777 } // end of wxApp::ProcessMessage
779 bool gbInOnIdle
= FALSE
;
787 // Avoid recursion (via ProcessEvent default case)
795 // If there are pending events, we must process them: pending events
796 // are either events to the threads other than main or events posted
797 // with wxPostEvent() functions
799 ProcessPendingEvents();
802 // 'Garbage' collection of windows deleted with Close().
804 DeletePendingObjects();
808 // Flush the logged messages if any
810 wxLog::FlushActive();
813 #if wxUSE_DC_CACHEING
814 // automated DC cache management: clear the cached DCs and bitmap
815 // if it's likely that the app has finished with them, that is, we
816 // get an idle event and we're not dragging anything.
817 if (!::WinGetKeyState(HWND_DESKTOP
, VK_BUTTON1
) &&
818 !::WinGetKeyState(HWND_DESKTOP
, VK_BUTTON3
) &&
819 !::WinGetKeyState(HWND_DESKTOP
, VK_BUTTON2
))
821 #endif // wxUSE_DC_CACHEING
824 // Send OnIdle events to all windows
826 if (SendIdleEvents())
829 // SendIdleEvents() returns TRUE if at least one window requested more
832 rEvent
.RequestMore(TRUE
);
835 } // end of wxApp::OnIdle
837 // Send idle event to all top-level windows
838 bool wxApp::SendIdleEvents()
840 bool bNeedMore
= FALSE
;
841 wxWindowList::Node
* pNode
= wxTopLevelWindows
.GetFirst();
845 wxWindow
* pWin
= pNode
->GetData();
847 if (SendIdleEvents(pWin
))
849 pNode
= pNode
->GetNext();
852 } // end of wxApp::SendIdleEvents
855 // Send idle event to window and all subwindows
857 bool wxApp::SendIdleEvents(
861 bool bNeedMore
= FALSE
;
864 vEvent
.SetEventObject(pWin
);
865 pWin
->GetEventHandler()->ProcessEvent(vEvent
);
867 if (vEvent
.MoreRequested())
870 wxNode
* pNode
= pWin
->GetChildren().First();
874 wxWindow
* pWin
= (wxWindow
*) pNode
->Data();
876 if (SendIdleEvents(pWin
))
878 pNode
= pNode
->Next();
881 } // end of wxApp::SendIdleEvents
883 void wxApp::OnEndSession(
884 wxCloseEvent
& WXUNUSED(rEvent
))
887 GetTopWindow()->Close(TRUE
);
888 } // end of wxApp::OnEndSession
891 // Default behaviour: close the application with prompts. The
892 // user can veto the close, and therefore the end session.
894 void wxApp::OnQueryEndSession(
900 if (!GetTopWindow()->Close(!rEvent
.CanVeto()))
903 } // end of wxApp::OnQueryEndSession
909 // VZ: must really exit somehow, insert appropriate OS/2 syscall (FIXME)
910 wxAppConsole::Exit();
914 // Yield to incoming messages
916 bool wxApp::Yield(bool onlyIfNeeded
)
918 static bool s_inYield
= FALSE
;
924 wxFAIL_MSG( _T("wxYield() called recursively") );
934 // Disable log flushing from here because a call to wxYield() shouldn't
935 // normally result in message boxes popping up &c
942 // We want to go back to the main message loop
943 // if we see a WM_QUIT. (?)
945 while (::WinPeekMsg(vHab
, &vMsg
, (HWND
)NULL
, 0, 0, PM_NOREMOVE
) && vMsg
.msg
!= WM_QUIT
)
948 wxMutexGuiLeaveOrEnter();
949 #endif // wxUSE_THREADS
950 if (!wxTheApp
->DoMessage())
954 // If they are pending events, we must process them.
957 wxTheApp
->ProcessPendingEvents();
960 // Let the logs be flashed again
967 int wxApp::AddSocketHandler(int handle
, int mask
,
968 void (*callback
)(void*), void * gsock
)
971 struct GsocketCallbackInfo
972 *CallbackInfo
= (struct GsocketCallbackInfo
*)m_sockCallbackInfo
;
974 for (find
= 0; find
< m_maxSocketHandles
; find
++)
975 if (CallbackInfo
[find
].handle
== -1)
977 if (find
== m_maxSocketHandles
)
979 // Allocate new memory
980 m_sockCallbackInfo
= realloc(m_sockCallbackInfo
,
981 (m_maxSocketHandles
+=10)*
982 sizeof(struct GsocketCallbackInfo
));
983 CallbackInfo
= (struct GsocketCallbackInfo
*)m_sockCallbackInfo
;
984 for (find
= m_maxSocketHandles
- 10; find
< m_maxSocketHandles
; find
++)
985 CallbackInfo
[find
].handle
= -1;
986 find
= m_maxSocketHandles
- 10;
988 CallbackInfo
[find
].proc
= callback
;
989 CallbackInfo
[find
].type
= mask
;
990 CallbackInfo
[find
].handle
= handle
;
991 CallbackInfo
[find
].gsock
= gsock
;
992 if (mask
& wxSockReadMask
)
993 FD_SET(handle
, &m_readfds
);
994 if (mask
& wxSockWriteMask
)
995 FD_SET(handle
, &m_writefds
);
996 if (handle
>= m_maxSocketNr
)
997 m_maxSocketNr
= handle
+ 1;
1001 void wxApp::RemoveSocketHandler(int handle
)
1003 struct GsocketCallbackInfo
1004 *CallbackInfo
= (struct GsocketCallbackInfo
*)m_sockCallbackInfo
;
1005 if (handle
< m_maxSocketHandles
)
1007 if (CallbackInfo
[handle
].type
& wxSockReadMask
)
1008 FD_CLR(CallbackInfo
[handle
].handle
, &m_readfds
);
1009 if (CallbackInfo
[handle
].type
& wxSockWriteMask
)
1010 FD_CLR(CallbackInfo
[handle
].handle
, &m_writefds
);
1011 CallbackInfo
[handle
].handle
= -1;
1015 //-----------------------------------------------------------------------------
1017 //-----------------------------------------------------------------------------
1019 void wxApp::WakeUpIdle()
1022 // Send the top window a dummy message so idle handler processing will
1023 // start up again. Doing it this way ensures that the idle handler
1024 // wakes up in the right thread (see also wxWakeUpMainThread() which does
1025 // the same for the main app thread only)
1027 wxWindow
* pTopWindow
= wxTheApp
->GetTopWindow();
1031 if ( !::WinPostMsg(GetHwndOf(pTopWindow
), WM_NULL
, (MPARAM
)0, (MPARAM
)0))
1034 // Should never happen
1036 wxLogLastError("PostMessage(WM_NULL)");
1039 } // end of wxWakeUpIdle