After I send a TB_DELETEBUTTON message to delete a button (of a external application) in the system-tray toolbar, it remains a blank/empty rectangle from that deleted button, and the toolbar does not remove this empty rectangle until I do left or right click on some other icon, then finally the toolbar window gets redrawn and the empty rectangle from he button that I deleted disappears.
This is an aesthetic issue that I would like to avoid. I just would like to programatically update/redraw the toolbar window after I send the TB_DELETEBUTTON message, however after I call the UpdateWindow, UpdateLayeredWindow or RedrawWindow, the empty rectangle of the deleted button remains there.
The flags cobmination that I tried to use with RedrawWindow are: RDW_FRAME, RDW_ALLCHILDREN, RDW_UPDATENOW and RDW_INVALIDATE, all together.
The window handle that I'm passing to these functions is the window with class name: "ToolbarWindow32" (on which reside the system-tray buttons/icons of the applications), a example for getting this window handle can be found here.
My question is: how can I properly update/redraw this window?.