+// ----------------------------------------------------------------------------
+// helper functions
+// ----------------------------------------------------------------------------
+
+// return the rectangle of the item at the given index
+//
+// returns an empty (0, 0, 0, 0) rectangle if fails so the caller may compare
+// r.right or r.bottom with 0 to check for this
+static RECT wxGetTBItemRect(HWND hwnd, int index)
+{
+ RECT r;
+
+ // note that we use TB_GETITEMRECT and not TB_GETRECT because the latter
+ // only appeared in v4.70 of comctl32.dll
+ if ( !::SendMessage(hwnd, TB_GETITEMRECT, index, (LPARAM)&r) )
+ {
+ wxLogLastError(wxT("TB_GETITEMRECT"));
+
+ r.top =
+ r.left =
+ r.right =
+ r.bottom = 0;
+ }
+
+ return r;
+}
+