winhlp32: Links are clicked on WM_LBUTTONDOWN not WM_LBUTTONUP.
This behaviour was tested against native winhlp32 by pressing down the
left mouse button and holding it while over the link to avoid having
WM_LBUTTONUP sent. I noticed that the action for clicking the link
happened right away, without waiting for me to release the mouse button.
diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c
index db9769a..b042a5a 100644
--- a/programs/winhlp32/winhelp.c
+++ b/programs/winhlp32/winhelp.c
@@ -842,12 +842,7 @@
switch (msg)
{
case WM_LBUTTONDOWN:
- if ((win->current_link = WINHELP_FindLink(win, lParam)))
- ret = TRUE;
- break;
-
- case WM_LBUTTONUP:
- if ((link = WINHELP_FindLink(win, lParam)) && link == win->current_link)
+ if ((link = WINHELP_FindLink(win, lParam)))
{
HLPFILE_WINDOWINFO* wi;
@@ -882,7 +877,6 @@
}
ret = TRUE;
}
- win->current_link = NULL;
break;
}
return ret;
@@ -917,11 +911,11 @@
(HWND)lParam == Globals.active_popup->hMainWnd ||
GetWindow((HWND)lParam, GW_OWNER) == Globals.active_win->hMainWnd)
break;
- case WM_LBUTTONUP:
case WM_LBUTTONDOWN:
- if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam) && msg == WM_LBUTTONDOWN)
+ if (WINHELP_HandleTextMouse(Globals.active_popup, msg, lParam))
return FALSE;
/* fall through */
+ case WM_LBUTTONUP:
case WM_MBUTTONDOWN:
case WM_RBUTTONDOWN:
case WM_NCLBUTTONDOWN:
diff --git a/programs/winhlp32/winhelp.h b/programs/winhlp32/winhelp.h
index 407089e..994547b 100644
--- a/programs/winhlp32/winhelp.h
+++ b/programs/winhlp32/winhelp.h
@@ -90,7 +90,6 @@
HBRUSH hBrush;
HLPFILE_WINDOWINFO* info;
- HLPFILE_LINK* current_link;
WINHELP_PAGESET back;
unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */