Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client-area of Tab control?

Tags:

c

tabs

winapi

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

like image 532
OJW Avatar asked Sep 15 '25 01:09

OJW


1 Answers

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.

like image 132
casablanca Avatar answered Sep 17 '25 16:09

casablanca