예제 #1
0
Tab *TabContainer::AddTab(const wchar_t *text)
{
	Tab *tab = new Tab(text, this);

	TCITEMW item;
	item.pszText = _wcsdup(text);
	item.mask = TCIF_TEXT | TCIF_PARAM;
	item.lParam = (LPARAM)tab;
	tab->m_id = TabCtrl_InsertItem(m_handle, INT_MAX, (LPARAM)&item);
	if(tab->m_id == 0)
	{
		tab->Show();
		tab->OnSelected();
	}
	return tab;
}