X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8614c467553e7dd8a5b9984683d73c89730b8ead..4634a5d6d71c051d189c8e58f13bda52a77bf8e3:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index fea94bda8b..87bc2b6ae5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -268,8 +268,11 @@ wxWindow::~wxWindow() if ( m_hWnd ) { - if ( !::DestroyWindow(GetHwnd()) ) - wxLogLastError("DestroyWindow"); + if (::IsWindow(GetHwnd())) + { + if ( !::DestroyWindow(GetHwnd()) ) + wxLogLastError("DestroyWindow"); + } // remove hWnd <-> wxWindow association wxRemoveHandleAssociation(this); @@ -1953,6 +1956,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) //else: get the dlg code from the DefWindowProc() break; + case WM_SYSKEYDOWN: case WM_KEYDOWN: // If this has been processed by an event handler, // return 0 now (we've handled it). @@ -2021,10 +2025,12 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) } break; + case WM_SYSKEYUP: case WM_KEYUP: processed = HandleKeyUp((WORD) wParam, lParam); break; + case WM_SYSCHAR: case WM_CHAR: // Always an ASCII character processed = HandleChar((WORD)wParam, lParam, TRUE); break; @@ -2283,12 +2289,16 @@ bool wxWindow::MSWCreate(int id, if ( width > -1 ) width1 = width; if ( height > -1 ) height1 = height; + // Unfortunately this won't work in WIN16. Unless perhaps + // we define WS_EX_CONTROLPARENT ourselves? +#ifndef __WIN16__ // if we have wxTAB_TRAVERSAL style, we want WS_EX_CONTROLPARENT or // IsDialogMessage() won't work for us if ( GetWindowStyleFlag() & wxTAB_TRAVERSAL ) { extendedStyle |= WS_EX_CONTROLPARENT; } +#endif HWND hParent = (HWND)NULL; if ( parent ) @@ -3641,6 +3651,8 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd) win = wxFindWinFromHandle((WXHWND)hwnd); if ( !win ) { + // the radiobox pointer is stored in GWL_USERDATA only under Win32 +#ifdef __WIN32__ // native radiobuttons return DLGC_RADIOBUTTON here and for any // wxWindow class which overrides WM_GETDLGCODE processing to // do it as well, win would be already non NULL @@ -3650,6 +3662,7 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd) win = (wxWindow *)::GetWindowLong(hwnd, GWL_USERDATA); } else +#endif // Win32 { // hwnd is not a wxWindow, try its parent next below hwnd = ::GetParent(hwnd);