extern void wxSetKeyboardHook(bool doIt);
extern wxCursor *g_globalCursor;
-HANDLE wxhInstance = 0;
+HINSTANCE wxhInstance = 0;
static MSG s_currentMsg;
wxApp *wxTheApp = NULL;
static HINSTANCE gs_hRichEdit = NULL;
#endif
-bool wxApp::Initialize(WXHANDLE instance)
+bool wxApp::Initialize(WXHINSTANCE instance)
{
- HANDLE hInstance = (HANDLE)instance;
+ HINSTANCE hInstance = (HINSTANCE) instance;
CommonInit();
wndclass2.hIcon = NULL;
wndclass2.hCursor = NULL;
// wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ;
- wndclass2.hbrBackground = GetStockObject( LTGRAY_BRUSH );
+ wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wndclass2.lpszMenuName = NULL;
wndclass2.lpszClassName = wxPanelClassName;
if (!RegisterClass( &wndclass2 ))
HWND hWnd;
- // Anyone for a message? Try youngest descendants first.
+ // Try translations first; find the youngest window with
+ // a translation table.
for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
{
wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
if (wnd)
{
- if (wnd->MSWProcessMessage(Msg))
+ if (wnd->MSWTranslateMessage(Msg))
return TRUE;
-
- // STOP if we've reached the top of the hierarchy!
-// if (m_topWindow && (wnd == m_topWindow))
-// return FALSE;
}
}
- // TODO: Is this now obsolete, given that m_topWindow may not be defined?
- // Does it do anything useful anyway?
-// if (m_topWindow && m_topWindow->MSWProcessMessage(Msg))
-// return TRUE;
- return FALSE;
+ // Anyone for a non-translation message? Try youngest descendants first.
+ for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
+ {
+ wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
+ if (wnd)
+ {
+ if (wnd->MSWProcessMessage(Msg))
+ return TRUE;
+ }
+ }
+ return FALSE;
}
void wxApp::OnIdle(wxIdleEvent& event)