Commit 4c572329 authored by Thomas Faber's avatar Thomas Faber Committed by Alexandre Julliard

comctl32: Unset the toolbar's hot item when deleting a button.

parent 0b8219da
......@@ -923,6 +923,16 @@ static void test_hotitem(void)
ok(ret == 1, "TB_GETHOTITEM returned %ld, expected 1\n", ret);
ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
/* deleting a button unsets the hot item */
ret = SendMessageA(hToolbar, TB_SETHOTITEM, 0, 0);
ok(ret == 1, "TB_SETHOTITEM returned %ld, expected 1\n", ret);
g_fReceivedHotItemChange = FALSE;
ret = SendMessageA(hToolbar, TB_DELETEBUTTON, 1, 0);
ok(ret == TRUE, "TB_DELETEBUTTON returned %ld, expected TRUE\n", ret);
ret = SendMessageA(hToolbar, TB_GETHOTITEM, 0, 0);
ok(ret == -1, "TB_GETHOTITEM returned %ld, expected -1\n", ret);
ok(g_fReceivedHotItemChange == FALSE, "Unexpected TBN_HOTITEMCHANGE\n");
DestroyWindow(hToolbar);
}
......
......@@ -3233,6 +3233,7 @@ TOOLBAR_DeleteButton (TOOLBAR_INFO *infoPtr, INT nIndex)
TOOLBAR_TooltipDelTool(infoPtr, &infoPtr->buttons[nIndex]);
infoPtr->nHotItem = -1;
if (infoPtr->nNumButtons == 1) {
TRACE(" simple delete\n");
free_string( infoPtr->buttons );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment