winhlp32: Prevent cursor flicker on mouse moves over richedit control.
authorDylan Smith <dylan.ah.smith@gmail.com>
Tue, 10 Mar 2009 19:19:59 +0000 (15:19 -0400)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 11 Mar 2009 12:03:33 +0000 (13:03 +0100)
commita36b408f7ee03df290ab599733c2e2c9fb10a6c6
tree3636b7718b2c7730d06be1db3d275cf5393a1793
parent908ff58339837272458c6598e9bd67cde1b8f36d
winhlp32: Prevent cursor flicker on mouse moves over richedit control.

Previously the cursor was being set by winhlp32 on WM_MOUSEMOVE, then
the richedit control would change it again on WM_SETCURSOR.  Since the
cursor set in both of these places was different, the cursor would
flicker from being frequently changed.

The reason winhlp32 is setting the cursor, rather than letting the
richedit control set the cursor, is that winhlp32 needs the hand cursor
to be shown over a link.  My first instinct was to just add the CFE_LINK
effect to the link characters, however this also forced a colour for the
link that was inconsistent with native winhlp32.  Native winhlp32
doesn't seem to load any richedit dll, so this doesn't imply that there
is an undocumented way of changing the colour of characters with
CFE_LINK.

This patch has winhlp32 override the WNDPROC for the richedit control to
handle the WM_SETCURSOR.  It simply sets the cursor to the hand if the
cursor is over the link, otherwise it just calls the original richedit
window proc.
programs/winhlp32/winhelp.c
programs/winhlp32/winhelp.h