Inserts a new tab in an existing tab control.
LONG InsertItem(
  int nItem,
  TCITEM* pTabCtrlItem 
);
LONG InsertItem(
  int nItem,
  LPCTSTR lpszItem 
);
LONG InsertItem(
  int nItem,
  LPCTSTR lpszItem,
  int nImage 
);
LONG InsertItem(
  UINT nMask,
  int nItem,
  LPCTSTR lpszItem,
  int nImage,
  LPARAM lParam 
);
LONG InsertItem( 
   UINT nMask, 
   int nItem, 
   LPCTSTR lpszItem, 
   int nImage, 
   LPARAM lParam, 
   DWORD dwState, 
   DWORD dwStateMask 
);
Parameters
- nItem 
 Zero-based index of the new tab.
- pTabCtrlItem 
 Pointer to a TCITEM structure that specifies the attributes of the tab.
- lpszItem 
 Address of a null-terminated string that contains the text of the tab.
- nImage 
 The zero-based index of an image to insert from an image list.
- nMask 
 Specifies which TCITEM structure attributes to set. Can be zero or a combination of the following values:- TCIF_TEXT The pszText member is valid. 
- TCIF_IMAGE The iImage member is valid. 
- TCIF_PARAM The lParam member is valid. 
- TCIF_RTLREADING The text of pszText is displayed using right-to-left reading order on Hebrew or Arabic systems. 
- TCIF_STATE The dwState member is valid. 
 
- lParam 
 Application-defined data associated with the tab.
- dwState 
 Specifies values for the item's states. For more information, see TCITEM in the Windows SDK.
- dwStateMask 
 Specifies which states are to be set. For more information, see TCITEM in the Windows SDK.
Return Value
Zero-based index of the new tab if successful; otherwise – 1.
Example
TCITEM tcItem;
tcItem.mask = TCIF_TEXT;
tcItem.pszText = _T("Tab #1");
m_TabCtrl.InsertItem(0, &tcItem);
Requirements
Header: afxcmn.h