I'm trying to get the client area of a tab control using TCM_ADJUSTRECT
+ TCM_GETITEMRECT
, I call TCM_GETITEMRECT
giving it the tab index then with that Rec filled in, call TCM_ADJUSTRECT
passing either true or false but when ever I move the only tab child window with MoveWindow:
User32.MoveWindow(hdl,r.left,r.top,width,height,1)
it's either cropped at the top or cropped at the bottom depending on the boolean passed to TCM_ADJUSTRECT
, I'm assuming its because the width and height values in MoveWindow
are from the tab control itself and I need to work out the client height from the TCM_ADJUSTRECT
but I'm not really sure how to get the width and height from the Rec structure:
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT;