- Merge from trunk up to r45543
[reactos.git] / base / applications / mscutils / devmgmt / mainwnd.c
index 1d9b45d..c978509 100644 (file)
@@ -342,12 +342,21 @@ OnNotify(PMAIN_WND_INFO Info,
         case NM_DBLCLK:
         {
             HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);
+            TV_HITTESTINFO HitTest;
 
             if (!TreeView_GetChild(Info->hTreeView,
                                    hSelected))
             {
-                OpenPropSheet(Info->hTreeView,
-                              hSelected);
+                if (GetCursorPos(&HitTest.pt) &&
+                    ScreenToClient(Info->hTreeView, &HitTest.pt))
+                {
+                    if (TreeView_HitTest(Info->hTreeView, &HitTest))
+                    {
+                        if (HitTest.hItem == hSelected)
+                            OpenPropSheet(Info->hTreeView,
+                                          hSelected);
+                    }
+                }
             }
         }
         break;
@@ -464,7 +473,7 @@ MainWndCommand(PMAIN_WND_INFO Info,
             DialogBox(hInstance,
                       MAKEINTRESOURCE(IDD_ABOUTBOX),
                       Info->hMainWnd,
-                      (DLGPROC)AboutDialogProc);
+                      AboutDialogProc);
 
             SetFocus(Info->hTreeView);
         }