extern void wxSetKeyboardHook(bool doIt);
extern wxCursor *g_globalCursor;
-HINSTANCE wxhInstance = 0;
MSG s_currentMsg;
wxApp *wxTheApp = NULL;
{
// Send the top window a dummy message so idle handler processing will
// start up again. Doing it this way ensures that the idle handler
- // wakes up in the right thread.
+ // wakes up in the right thread (see also wxWakeUpMainThread() which does
+ // the same for the main app thread only)
wxWindow *topWindow = wxTheApp->GetTopWindow();
- if ( topWindow ) {
- HWND hWnd = (HWND)topWindow->GetHWND();
- ::PostMessage(hWnd, WM_NULL, 0, 0);
+ if ( topWindow )
+ {
+ if ( !::PostMessage(GetHwndOf(topWindow), WM_NULL, 0, 0) )
+ {
+ // should never happen
+ wxLogLastError("PostMessage(WM_NULL)");
+ }
}
}
}
}
-
-HINSTANCE wxGetInstance()
-{
- return wxhInstance;
-}
-
-void wxSetInstance(HINSTANCE hInst)
-{
- wxhInstance = hInst;
-}
-
// For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
// if in a separate file. So include it here to ensure it's linked.
#if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__))