mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 05:01:03 +00:00
[DEVMGR] Ensure clicking on item when opening property sheet (#4196)
Fix a bug related to the device manager, where double-clicking anywhere when an item is already selected opens the property sheet. CORE-17207
This commit is contained in:
parent
dc483bd700
commit
5831427ef9
3 changed files with 26 additions and 1 deletions
|
@ -124,6 +124,27 @@ CDeviceView::OnSize(
|
|||
return 0;
|
||||
}
|
||||
|
||||
LRESULT
|
||||
CDeviceView::OnDoubleClick(
|
||||
_In_ LPNMHDR NmHdr
|
||||
)
|
||||
{
|
||||
TVHITTESTINFO hitInfo;
|
||||
HTREEITEM hItem;
|
||||
|
||||
GetCursorPos(&hitInfo.pt);
|
||||
ScreenToClient(m_hTreeView, &hitInfo.pt);
|
||||
|
||||
// Check if we are trying to double click an item
|
||||
hItem = TreeView_HitTest(m_hTreeView, &hitInfo);
|
||||
if (hItem != NULL && (hitInfo.flags & (TVHT_ONITEM | TVHT_ONITEMICON)))
|
||||
{
|
||||
DisplayPropertySheet();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
LRESULT
|
||||
CDeviceView::OnRightClick(
|
||||
_In_ LPNMHDR NmHdr
|
||||
|
|
|
@ -45,6 +45,10 @@ public:
|
|||
_In_ int cy
|
||||
);
|
||||
|
||||
LRESULT OnDoubleClick(
|
||||
_In_ LPNMHDR NmHdr
|
||||
);
|
||||
|
||||
LRESULT OnRightClick(
|
||||
_In_ LPNMHDR NmHdr
|
||||
);
|
||||
|
|
|
@ -515,7 +515,7 @@ CDeviceManager::OnNotify(_In_ LPARAM lParam)
|
|||
|
||||
case NM_DBLCLK:
|
||||
{
|
||||
m_DeviceView->DisplayPropertySheet();
|
||||
Ret = m_DeviceView->OnDoubleClick(NmHdr);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue