The TB_BUTTONCOUNT message retrieves a count of the buttons currently in the toolbar.
TB_BUTTONCOUNT wParam = 0; lParam = 0;
Returns the count of the buttons.