If the user doubleclicked a treeview item, make sure the doubleclicked item has alrea...
authorEric Kohl <eric.kohl@reactos.org>
Tue, 22 Dec 2009 17:00:45 +0000 (17:00 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 22 Dec 2009 17:00:45 +0000 (17:00 +0000)
svn path=/trunk/; revision=44716

reactos/base/applications/mscutils/devmgmt/mainwnd.c

index 68ad01a..c978509 100644 (file)
@@ -342,12 +342,21 @@ OnNotify(PMAIN_WND_INFO Info,
         case NM_DBLCLK:
         {
             HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);
         case NM_DBLCLK:
         {
             HTREEITEM hSelected = TreeView_GetSelection(Info->hTreeView);
+            TV_HITTESTINFO HitTest;
 
             if (!TreeView_GetChild(Info->hTreeView,
                                    hSelected))
             {
 
             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;
             }
         }
         break;