From: Esme Povirk esme@codeweavers.com
--- dlls/user32/listbox.c | 2 ++ dlls/user32/tests/msg.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index d3ca2ccb951..c2df4da5807 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1635,6 +1635,8 @@ static LRESULT LISTBOX_InsertItem( LB_DESCR *descr, INT index, descr->self, index, str ? debugstr_w(str) : "", get_item_height(descr, index)); }
+ NtUserNotifyWinEvent( EVENT_OBJECT_CREATE, descr->self, OBJID_CLIENT, index + 1 ); + /* Repaint the items */
LISTBOX_UpdateScroll( descr ); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9b2d71c679a..25a7857d97c 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16885,41 +16885,41 @@ static const struct message wm_lb_deletestring_reset[] = static const struct message wm_lb_addstring[] = { { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed }, /* Child ID changes each test, don't test lparam. */ - { EVENT_OBJECT_CREATE, winevent_hook|wparam|msg_todo, OBJID_CLIENT, 0 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam, OBJID_CLIENT, 0 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|msg_todo, OBJID_CLIENT, 0 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam, OBJID_CLIENT, 0 }, { 0 } }; static const struct message wm_lb_addstring_ownerdraw[] = { { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf0f2, 0xf30604ed }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf1f2, 0xf30604ee }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 2 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf2f2, 0xf30604ef }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 3 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 }, { 0 } }; static const struct message wm_lb_addstring_sort_ownerdraw[] = { { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf0f2, 0xf30604ed }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee }, { WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ed, 0xf30604ee }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf1f2, 0xf30604ee }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 2 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 }, { LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef }, { WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ed, 0xf30604ef }, { WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ee, 0xf30604ef }, { WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf2f2, 0xf30604ef }, - { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 3 }, + { EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 }, { 0 } }; static const struct message wm_lb_dblclick_0[] =
From: Esme Povirk esme@codeweavers.com
--- dlls/user32/listbox.c | 2 ++ dlls/user32/tests/msg.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index c2df4da5807..831327f2349 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1736,6 +1736,8 @@ static LRESULT LISTBOX_RemoveItem( LB_DESCR *descr, INT index ) /* We need to invalidate the original rect instead of the updated one. */ LISTBOX_InvalidateItems( descr, index );
+ NtUserNotifyWinEvent( EVENT_OBJECT_DESTROY, descr->self, OBJID_CLIENT, index + 1 ); + if (descr->nb_items == 1) { SendMessageW(descr->self, LB_RESETCONTENT, 0, 0); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 25a7857d97c..4d0d643ef9f 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -16866,7 +16866,7 @@ static const struct message wm_lb_click_0[] = static const struct message wm_lb_deletestring[] = { { LB_DELETESTRING, sent|wparam|lparam, 0, 0 }, - { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 }, + { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 }, { WM_DELETEITEM, sent|wparam|parent|optional, ID_LISTBOX, 0 }, { WM_DRAWITEM, sent|wparam|parent|optional, ID_LISTBOX }, { WM_DRAWITEM, sent|wparam|parent|optional, ID_LISTBOX }, @@ -16875,7 +16875,7 @@ static const struct message wm_lb_deletestring[] = static const struct message wm_lb_deletestring_reset[] = { { LB_DELETESTRING, sent|wparam|lparam, 0, 0 }, - { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 1 }, + { EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 }, { LB_RESETCONTENT, sent|wparam|lparam|defwinproc|optional, 0, 0 }, { WM_DELETEITEM, sent|wparam|parent|optional, ID_LISTBOX, 0 }, { WM_DRAWITEM, sent|wparam|parent|optional, ID_LISTBOX },