Nikolay Sivov : regedit: Simplify double-click listview handler.

Alexandre Julliard julliard at winehq.org
Fri Jul 14 16:08:08 CDT 2017


Module: wine
Branch: master
Commit: cbd6e05e681ffc08cdaf89d00d041aae59c40d5a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cbd6e05e681ffc08cdaf89d00d041aae59c40d5a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Jul 14 00:27:11 2017 +0300

regedit: Simplify double-click listview handler.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/regedit/childwnd.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 1797b52..f2359c4 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -347,12 +347,8 @@ static int listview_notify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
         case NM_DBLCLK:
         {
             NMITEMACTIVATE *nmitem = (NMITEMACTIVATE *)lParam;
-            LVHITTESTINFO info;
 
-            info.pt.x = nmitem->ptAction.x;
-            info.pt.y = nmitem->ptAction.y;
-
-            if (SendMessageW(g_pChildWnd->hListWnd, LVM_HITTEST, 0, (LPARAM)&info) != -1)
+            if (nmitem->iItem != -1)
             {
                 LVITEMW item;
 
@@ -362,7 +358,7 @@ static int listview_notify(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam
 
                 item.state = LVIS_FOCUSED | LVIS_SELECTED;
                 item.stateMask = LVIS_FOCUSED | LVIS_SELECTED;
-                SendMessageW(g_pChildWnd->hListWnd, LVM_SETITEMSTATE, info.iItem, (LPARAM)&item);
+                SendMessageW(g_pChildWnd->hListWnd, LVM_SETITEMSTATE, nmitem->iItem, (LPARAM)&item);
 
                 SendMessageW(hFrameWnd, WM_COMMAND, ID_EDIT_MODIFY, 0);
             }




More information about the wine-cvs mailing list