0

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;
manuell
  • 7,528
  • 5
  • 31
  • 58
Col_Blimp
  • 779
  • 2
  • 8
  • 26
  • 3
    rect width: right - left, rect height: bottom - top – user2120666 Jan 12 '14 at 20:14
  • thanks user2120666, you knw now knowing how to work out the height has helped but the returned REC is still off a bit although its easy to correct by deducting 5 pixels from the right. – Col_Blimp Jan 15 '14 at 18:42

0 Answers0