How to get the “inside” of a tab control, i.e. the area in which you can place controls?
// doesn't work:
WINDOWINFO tabsInfo;
GetWindowInfo(GetDlgItem(hwndDialog, IDC_TABS), &tabsInfo);
MoveWindow(someHwnd, tabsInfo.rcClient.left, tabsInfo.rcClient.top, ...
tabsInfo.rcClient gives the entire region used by the tab control, including its own controls
You can use
TabCtrl_AdjustRect— pass in the bounding rectangle of the tab control and on output, the rectangle will be adjusted to the content area.Also, if you only need the client rectangle of the window, it’s simpler to use
GetClientRectinstead ofGetWindowInfo.