Hi, I have created my tabs, but how would i add controls to each of the tabs?
HWND hWndTab = CreateWindowEx(0, "SysTabControl32", "",
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
0, 20, 500, 250,
hWndDiag, NULL, hDiagInst, NULL);
tie.mask = TCIF_TEXT;
tie.pszText = "STUFF 1";
TabCtrl_InsertItem(hWndTab, 0, &tie);
tie.mask = TCIF_TEXT;
tie.pszText = "STUFF 2";
TabCtrl_InsertItem(hWndTab, 1, &tie);
Windows specific question moved.
The tabs are not really tabs as such, you could capture the change tab event and change a child-window (with controls which contents reflects the name of the tab).
In other words, you'll need a child window (or several) which you juggle the displays of with ShowWindow or such. Research into the tab control and child windows is required.
If you use the CHILD style you must set the HMENU param to the childs ID. This can then be used in the callback or GetDlgItem() macro ect.
//in resource.h is the best place for all these
//look at resoruce.h and how it keeps a running total and edit yours in
#define IDC_MYTAB 40001//for example
//in the createwindow HMENU param
To add a control just create another window with the right controls name. I would use the dialog as the parent and set the Z order with SetWindowPos() (top or bottom of the layers, main screen->dialog->TAB->control) and ShowWindow() to show/hide it as required.
You can 'paste' a whole dialog on top of the TAB control. Reflect (move, size ect) messages from the TABs parent to the 'pasted' dialogs callback.
word of the wise, I used a similar process in my application: instead of using "tabs" I just cleared the window of all controls (hid them) then displayed another set of controls. Needless to say this is VERY inefficient as not only will you need to go through a great deal of ShowWindow/EnableWindow combinations, sometimes it takes so long you can even just make out the window re-drawing. I'm curious to see if anyone comes up with a better solution.
Child windows with controls in them and show/hide the child windows.
Originally Posted by @nthony
Thanks, after reading through Child Windows I see what you mean now. I was mistakingly thinking "child windows = controls", and completely missed their other role as dividors of parent client areas.
It looks at this example in the section “Arquivos” ("Files") of this group:
To have access to the group it is necessary to have a ID of yahoo, the project calls “TabControl.zip” and meets in the sub-folder “Windows Controls”.
After that it will be connected to the group, makes download here.