]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Initializing more variables in wxGrid::Create()
[wxWidgets.git] / src / msw / window.cpp
index fea94bda8b0118f8c80e1e250bc670bc1171422c..87bc2b6ae540d85d6485b161647745f77681093c 100644 (file)
@@ -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);