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, tabsI开发者_Go百科nfo.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 GetClientRect
instead of GetWindowInfo
.
精彩评论