Fix SetHotItem

Aric Stewart aric at codeweavers.com
Thu Feb 15 18:42:56 CST 2001


I missed a subtly of the code where Setting the HotItem to -1 can be
disastrous at times if it equals oldhit. However -1 is the windows
default setting for no hot item. So we internally make that -1 a -2.

-aric
-------------- next part --------------
Index: dlls/comctl32/toolbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/toolbar.c,v
retrieving revision 1.79
diff -u -u -r1.79 toolbar.c
--- dlls/comctl32/toolbar.c	2001/02/15 21:25:03	1.79
+++ dlls/comctl32/toolbar.c	2001/02/16 00:27:45
@@ -3369,6 +3369,9 @@
     INT nOldHotItem = infoPtr->nHotItem;
     TBUTTON_INFO *btnPtr;
 
+    if ((INT) wParam < 0 || (INT)wParam > infoPtr->nNumButtons)
+        wParam = -2;
+
     if (GetWindowLongA (hwnd, GWL_STYLE) & TBSTYLE_FLAT)
     {
 


More information about the wine-patches mailing list