当前位置: 首页>>代码示例>>C++>>正文


C++ TabCtrl_InsertItem函数代码示例

本文整理汇总了C++中TabCtrl_InsertItem函数的典型用法代码示例。如果您正苦于以下问题:C++ TabCtrl_InsertItem函数的具体用法?C++ TabCtrl_InsertItem怎么用?C++ TabCtrl_InsertItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TabCtrl_InsertItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SkinEdit_Invoke

HWND SkinEdit_Invoke(WPARAM wParam, LPARAM lParam)
{
    SKINDESCRIPTION *psd = (SKINDESCRIPTION *)lParam;
    TCITEM  tci = {0};
    RECT    rcClient;
    int     iTabs;

    if(psd->cbSize != sizeof(SKINDESCRIPTION))
        return 0;

    iTabs = TabCtrl_GetItemCount(psd->hWndTab);
    GetClientRect(psd->hWndParent, &rcClient);

    tci.mask = TCIF_PARAM|TCIF_TEXT;
    tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SKINITEMEDIT), psd->hWndParent, (DLGPROC)SkinEdit_ExtBkDlgProc, (LPARAM)psd);

    tci.pszText = TranslateT("Skin items");
    TabCtrl_InsertItem(psd->hWndTab, iTabs++, &tci);
    MoveWindow((HWND)tci.lParam, 5, 25, rcClient.right - 9, rcClient.bottom - 65, 1);
    psd->hwndSkinEdit = (HWND)tci.lParam;

    tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_IMAGEITEMEDIT), psd->hWndParent, (DLGPROC)SkinEdit_ImageItemEditProc, (LPARAM)psd);
    tci.pszText = TranslateT("Image items");
    TabCtrl_InsertItem(psd->hWndTab, iTabs++, &tci);
    MoveWindow((HWND)tci.lParam, 5, 25, rcClient.right - 9, rcClient.bottom - 65, 1);
    psd->hwndImageEdit = (HWND)tci.lParam;
    
    return(psd->hwndSkinEdit);
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:29,代码来源:skinedit.cpp

示例2: GetDlgItem

BOOL OgreMaxExport::setupExportProperties() {

    // add tabs to the tab control
    TCITEM tci;
    HWND tabCtrl = GetDlgItem(m_hWndDlgExport, IDC_TABCONTROL);

    tci.mask = TCIF_TEXT;
    tci.pszText = "General";
    TabCtrl_InsertItem(tabCtrl, 0, &tci);
    tci.pszText = "Mesh";
    TabCtrl_InsertItem(tabCtrl, 1, &tci);
    tci.pszText = "Skeletal Animation";
    TabCtrl_InsertItem(tabCtrl, 2, &tci);
    tci.pszText = "Vertex Animation";
    TabCtrl_InsertItem(tabCtrl, 3, &tci);
    tci.pszText = "Material";
    TabCtrl_InsertItem(tabCtrl, 4, &tci);

    // simulate tab select
    onTabSelectChange(tabCtrl, IDC_TABCONTROL);

    std::string filename;

    CenterWindow(m_hWndDlgExport,GetParent(m_hWndDlgExport));

    return TRUE;
}
开发者ID:sdfwds4,项目名称:ogre3d-game-editor,代码行数:27,代码来源:OgreMaxExport.cpp

示例3: _T

LRESULT CColorPicker::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	RECT rc = {0, 0, 0, 0};		

	m_wndPalette.Create(m_hWnd, rc, _T(""), WS_CHILD |  BS_NOTIFY  | BS_OWNERDRAW, 0, 1);
	m_winTab.SubclassWindow(GetDlgItem(IDC_TAB));
	m_winList.SubclassWindow(GetDlgItem(IDC_LIST));

	TC_ITEM tci;
	memset(&tci, 0, sizeof TC_ITEM);
	tci.mask = TCIF_TEXT;

	tci.pszText = _T("调色板");
	TabCtrl_InsertItem(m_winTab, 0, &tci);

	tci.pszText = _T("系统");
	TabCtrl_InsertItem(m_winTab, 1, &tci);
	
	for(int i = 0; m_SystemColors[i].clr; i++)
	{
		int nIdx = m_winList.SendMessage(LB_ADDSTRING, 0, (LPARAM)_T(""));
		m_winList.SendMessage(LB_SETITEMDATA, nIdx, i);
	}
		
	m_hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
		
	m_winTab.SendMessage(WM_SETFONT, (WPARAM)m_hFont, true);
	m_winList.SendMessage(WM_SETFONT,(WPARAM)m_hFont, true);
	m_wndPalette.SetFont(m_hFont, true);
		
	return 0;
}
开发者ID:JackWangCUMT,项目名称:SuperCxHMI,代码行数:32,代码来源:ColorPicker.cpp

示例4: Dialog

CDisasm::CDisasm(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu) : Dialog((LPCSTR)IDD_DISASM, _hInstance, _hParent)
{
	cpu = _cpu;

	SetWindowText(m_hDlg,_cpu->GetName());
#ifdef THEMES
	//if (WTL::CTheme::IsThemingSupported())
		//EnableThemeDialogTexture(m_hDlg ,ETDT_ENABLETAB);
#endif
	SetWindowPos(m_hDlg,0,500,200,0,0,SWP_NOSIZE);

	CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
	ptr->setDebugger(cpu);
	ptr->gotoAddr(0x00000000);

	CtrlRegisterList *rl = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));

  rl->setCPU(cpu);

	GetWindowRect(m_hDlg,&minRect);

	//symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
	symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);

	GetWindowRect(GetDlgItem(m_hDlg, IDC_REGLIST),&regRect);
	GetWindowRect(GetDlgItem(m_hDlg, IDC_DISASMVIEW),&disRect);

	HWND tabs = GetDlgItem(m_hDlg, IDC_LEFTTABS);

	TCITEM tcItem;
	ZeroMemory (&tcItem,sizeof (tcItem));
	tcItem.mask			= TCIF_TEXT;
	tcItem.dwState		= 0;
	tcItem.pszText		= "Regs";
	tcItem.cchTextMax	= (int)strlen(tcItem.pszText)+1;
	tcItem.iImage		= 0;
	int result1 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
	tcItem.pszText		= "Funcs";
	tcItem.cchTextMax	= (int)strlen(tcItem.pszText)+1;
	int result2 = TabCtrl_InsertItem(tabs, TabCtrl_GetItemCount(tabs),&tcItem);
	ShowWindow(GetDlgItem(m_hDlg, IDC_REGLIST), SW_NORMAL);
	ShowWindow(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST), SW_HIDE);
	SetTimer(m_hDlg,1,1000,0);
	/*
	DWORD intAddress[14] =
	{0x100, 0x200,0x300,0x400,0x500,0x600,0x700,0x800,0x900,0xc00,0xd00,0xf00,0x1300,0x1700};
	char *intName[14] = 
	{"100 Reset","200 Mcheck", "300 DSI","400 ISI","500 External",
	"600 Align","700 Program","800 FPU N/A","900 DEC","C00 SC",
	"D00 Trace","F00 Perf","1300 Breakpt","1700 Thermal"};*/

	//
	// --- activate debug mode ---
	//

	SetDebugMode(true);
}
开发者ID:Bennieboj,项目名称:ppsspp,代码行数:57,代码来源:Debugger_Disasm.cpp

示例5: CT_BUTTON

INT_PTR DialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam)
{
	static const ControlTemplate::Control s_Controls[] =
	{
		CT_BUTTON(Id_CloseButton, ID_STR_CLOSE,
			344, 191, 50, 14,
			WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON, 0),
		CT_TAB(Id_Tab, 0,
			6, 6, 388, 181,
			WS_VISIBLE | WS_TABSTOP | TCS_FIXEDWIDTH, 0)  // Last for correct tab order.
	};

	CreateControls(s_Controls, _countof(s_Controls), m_Font, GetString);

	HWND item = GetControl(Id_Tab);
	m_TabLog.Create(m_Window);
	m_TabSkins.Create(m_Window);
	m_TabPlugins.Create(m_Window);
	m_TabVersion.Create(m_Window);

	TCITEM tci = {0};
	tci.mask = TCIF_TEXT;
	tci.pszText = GetString(ID_STR_LOG);
	TabCtrl_InsertItem(item, 0, &tci);
	tci.pszText = GetString(ID_STR_SKINS);
	TabCtrl_InsertItem(item, 1, &tci);
	tci.pszText = GetString(ID_STR_PLUGINS);
	TabCtrl_InsertItem(item, 2, &tci);
	tci.pszText = GetString(ID_STR_VERSION);
	TabCtrl_InsertItem(item, 3, &tci);

	HICON hIcon = GetIcon(IDI_RAINMETER);
	SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);

	item = GetControl(Id_CloseButton);
	SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE);

	if (IsWindowsVistaOrGreater())
	{
		item = m_TabLog.GetControl(TabLog::Id_ItemsListView);
		SetWindowTheme(item, L"explorer", nullptr);
		item = m_TabSkins.GetControl(TabSkins::Id_ItemsListView);
		SetWindowTheme(item, L"explorer", nullptr);
	}

	if (c_WindowPlacement.length == 0)
	{
		c_WindowPlacement.length = sizeof(WINDOWPLACEMENT);
		GetWindowPlacement(m_Window, &c_WindowPlacement);
	}
	SetWindowPlacement(m_Window, &c_WindowPlacement);

	return TRUE;
}
开发者ID:AlonTzarafi,项目名称:rainmeter,代码行数:54,代码来源:DialogAbout.cpp

示例6: SetupRSP_RegistersMain

void SetupRSP_RegistersMain (HWND hDlg) {
#define WindowWidth  630
#define WindowHeight 325
	DWORD X, Y;

	hTab = CreateWindowEx(0,WC_TABCONTROL,"", WS_TABSTOP | WS_CHILD | WS_VISIBLE,5,6,616,290,
		hDlg,(HMENU)IDC_TAB_CONTROL,hinstDLL,NULL );
	if ( hTab ) {
		TC_ITEM item;
		SendMessage(hTab, WM_SETFONT, (WPARAM)GetStockObject( DEFAULT_GUI_FONT ), 0);
		item.mask    = TCIF_TEXT | TCIF_PARAM;
		item.pszText = " General Purpose ";
		item.lParam  = GeneralPurpose;
		TabCtrl_InsertItem( hTab,0, &item);
		item.lParam  = ControlProcessor0;
		item.pszText = " Control Processor 0 ";
		TabCtrl_InsertItem( hTab,1, &item);
		item.lParam  = HiddenRegisters;
		item.pszText = " Hidden Registers ";
		TabCtrl_InsertItem( hTab,2, &item);
		item.lParam  = Vector1;
		item.pszText = " RSP Vectors $v0 - $v15 ";
		TabCtrl_InsertItem( hTab,3, &item);
		item.lParam  = Vector2;
		item.pszText = " RSP Vectors $v16 - $v31 ";
		TabCtrl_InsertItem( hTab,4, &item);
	}
	
    SetupRSP_HiddenPanel ( hDlg );
	SetupRSP_CP0Panel   ( hDlg );
	SetupRSP_GPRPanel   ( hDlg );
	SetupRSP_Vect1Panel ( hDlg );
	SetupRSP_Vect2Panel ( hDlg );

	hStatic = CreateWindowEx(0,"STATIC","", WS_CHILD|WS_VISIBLE, 5,6,616,290,hDlg,0,hinstDLL,NULL );
#ifdef _M_IX86
	RefreshProc = (FARPROC)SetWindowLong(hStatic, GWL_WNDPROC, (long)RefreshRSP_RegProc);
#else
	DebugBreak();
#endif

	UpdateRSPRegistersScreen ();
	ShowRSP_RegisterPanel ( GeneralPurpose );
	SetWindowText(hDlg," RSP Registers");
	
	//if ( !GetStoredWinPos( "RSP Registers", &X, &Y ) ) {
		X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2;
		Y = (GetSystemMetrics( SM_CYSCREEN ) - WindowHeight) / 2;
	//}
	SetWindowPos(hDlg,NULL,X,Y,WindowWidth,WindowHeight, SWP_NOZORDER | SWP_SHOWWINDOW);
}
开发者ID:173210,项目名称:project64,代码行数:51,代码来源:RSP+Register.c

示例7: TabView_Reset

void TabView_Reset(HWND hwndTabView)
{
	struct TabViewInfo *pTabViewInfo;
	TC_ITEM tci;
	int i;
	TCHAR* t_text;
	HRESULT res;
	BOOL b_res;

	pTabViewInfo = GetTabViewInfo(hwndTabView);

	b_res = TabCtrl_DeleteAllItems(hwndTabView);

	memset(&tci, 0, sizeof(tci));
	tci.mask = TCIF_TEXT;
	tci.cchTextMax = 20;

	for (i = 0; i < pTabViewInfo->nTabCount; i++)
	{
		if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
		{
			t_text = tstring_from_utf8(pTabViewInfo->pCallbacks->pfnGetTabLongName(i));
			if( !t_text )
				return;
			tci.pszText = t_text;
			res = TabCtrl_InsertItem(hwndTabView, i, &tci);
			osd_free(t_text);
		}
	}
	TabView_UpdateSelection(hwndTabView);
}
开发者ID:cdrr,项目名称:mameui,代码行数:31,代码来源:tabview.cpp

示例8: _

wyBool 
ConnectionCommunity::CreateTabs(HWND hwnd, wyUInt32 id, wyBool ispowertools)
{
	HWND        hwndtab;
	wyWChar*     titles[]  = {L"MySQL", L"HTTP", L"SSH", L"SSL", _(L"Advanced")};
	wyInt32     numtabs, count;
	TCITEM		tci = {0};

	//if connection dialog is of powertools, then no advanced tab
	if(ispowertools == wyFalse)
		numtabs = sizeof(titles)/ sizeof(titles[0]);
	else
		numtabs = (sizeof(titles)/ sizeof(titles[0])) - 1;

	/* get the tab window */
	VERIFY(hwndtab = GetDlgItem(hwnd, id));

	for(count = 0; count < numtabs; count++)
	{
		tci.mask	= TCIF_TEXT ;//| TCIF_IMAGE;
		tci.pszText = titles[count];

		VERIFY(TabCtrl_InsertItem(hwndtab, 2000, &tci)!= -1);
	}

	return wyTrue;
}
开发者ID:ArsalanYaqoob,项目名称:sqlyog-community,代码行数:27,代码来源:ConnectionCommunity.cpp

示例9: AddTab

int AddTab(HWND TabWindow, HWND Window, const TCHAR* Caption, int Index)
{
	assert(IsWindow(TabWindow));
	assert(IsWindow(Window));
	assert(Caption);

	if(Index == -1)
		Index = TabCtrl_GetItemCount(TabWindow);

	assert(Index >= 0);

	TC_ITEM TabData;
	TabData.mask       = TCIF_TEXT | TCIF_PARAM;
	TabData.pszText    = const_cast<TCHAR*>(Caption);
	TabData.cchTextMax = _tcslen(Caption) + 1;
	TabData.lParam     = reinterpret_cast<LPARAM>(Window);

	Index = TabCtrl_InsertItem(TabWindow, Index, &TabData);
	if(Index != -1)
	{
		RECT TabRect;
		GetWindowRect(TabWindow, &TabRect);
		MapWindowPoints(HWND_DESKTOP, GetParent(TabWindow), reinterpret_cast<POINT*>(&TabRect), 2);
		TabCtrl_AdjustRect(TabWindow, false, &TabRect);
		TabRect.right  -= TabRect.left; // .right  == width
		TabRect.bottom -= TabRect.top;  // .bottom == heigth
		SetWindowPos(Window, HWND_BOTTOM, TabRect.left, TabRect.top, TabRect.right, TabRect.bottom, SWP_HIDEWINDOW);
		SetProp(TabWindow, PropName, Window);
		SetTabThemeTexture(Window, true);
	}
	return Index;
}
开发者ID:pezcode,项目名称:FireFly,代码行数:32,代码来源:tabs.cpp

示例10: TabView_Reset

void TabView_Reset(HWND hWndTabView)
{
    struct TabViewInfo *pTabViewInfo = GetTabViewInfo(hWndTabView);
    TCITEM tci;

    (void)TabCtrl_DeleteAllItems(hWndTabView);

    memset(&tci, 0, sizeof(TCITEM));
    tci.mask = TCIF_TEXT | TCIF_IMAGE;
    tci.cchTextMax = 20;

    for (int i = 0; i < pTabViewInfo->nTabCount; i++)
    {
        if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
        {
            TCHAR *t_text = tstring_from_utf8(pTabViewInfo->pCallbacks->pfnGetTabLongName(i));

            if(!t_text)
                return;

            tci.pszText = t_text;
            tci.iImage = i;
            (void)TabCtrl_InsertItem(hWndTabView, i, &tci);
            free(t_text);
        }
    }

    TabView_UpdateSelection(hWndTabView);
}
开发者ID:h0tw1r3,项目名称:mameuifx,代码行数:29,代码来源:tabview.cpp

示例11: HexCreateNewFile

BOOL HexCreateNewFile(MAINWND *mainWnd)
{
	// create a new
	int count;

	TCITEM tci = { TCIF_TEXT|TCIF_PARAM, 0, 0, TEXT("(Untitled)"), 0, 0 }; 
	
	tci.lParam = (LPARAM)CreateHexViewCtrl(mainWnd->hwndMain);

	g_fFileChanged   = FALSE;

	// reset to an empty file
	SetWindowFileName(mainWnd->hwndMain, TEXT("Untitled"), FALSE, FALSE);

	g_szFileTitle[0] = '\0';
	g_szFileName[0]  = '\0';
	g_fFileChanged   = FALSE;
	
	// insert at the end of the tab-list
	count = TabCtrl_GetItemCount(mainWnd->hwndTabView);
	TabCtrl_InsertItem(mainWnd->hwndTabView, count, &tci);
	
	HexSetCurFile(mainWnd->hwndMain, count, TRUE);
	return TRUE;
}
开发者ID:avplayer,项目名称:avdbg,代码行数:25,代码来源:OpenSave.c

示例12: ATLTRACE

LRESULT CFireTabCtrl::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    ATLTRACE(_T("CFireTabDlg::OnCreate()\n"));

    // Setup and create the tab control
    int nTabs = 3;
    _TCHAR *pszNames[] = { _T("Wood"), _T("Natural Gas"), _T("Kryptonite") };
    RECT rc;
    GetWindowRect(&rc);
    rc.right -= rc.left;
    rc.bottom -= rc.top;
    rc.top = rc.left = 0;
    m_ctlSysTabControl32.Create(m_hWnd, rc,_T(""), WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE | TCS_TABS );
    TC_ITEM tie;
    for( int i = 0; i < nTabs; i++ )
    {
        tie.mask = TCIF_TEXT | TCIF_IMAGE;
        tie.iImage = -1;
        tie.pszText = pszNames[i];
        tie.cchTextMax = (int)_tcslen(pszNames[i]);
        if (TabCtrl_InsertItem (m_ctlSysTabControl32.m_hWnd, i, &tie) == -1)
        {
            // The insert failed; display an error box.
            ::MessageBox (NULL, _T("TabCtrl_InsertItem failed!"), NULL, MB_OK);
            return E_FAIL;
        }
    }

    m_Display.Create(m_ctlSysTabControl32.m_hWnd);
    TabCtrl_SetCurSel(m_ctlSysTabControl32.m_hWnd, m_Display.m_curColor);
    m_Display.ShowWindow(TRUE);
    return 0;
}
开发者ID:jetlive,项目名称:skiaming,代码行数:33,代码来源:FireTabCtrl.cpp

示例13: LPWSTR

void PropertyPageHandler_BaseReloc::OnInitDialog()
{
	// Insert Tabs
	TCITEM item;

	for (int i = 0; i < m_PEReaderWriter.getNoOfBaseRelocationTables(); ++i)
	{
		item.mask = TCIF_TEXT;
		item.pszText = LPWSTR(_wcsdup(wstring(L"Table " + DWORD_toString(i + 1)).c_str()));

		TabCtrl_InsertItem(m_hTabsBaseReloc, i, &item);
		free(item.pszText);
	}

	// Insert ListView columns
	LV_COLUMN column;
	ZeroMemory(&column, sizeof(LV_COLUMN));

	for (size_t i = 0; i < ARRAYSIZE(szGenericColumnText); ++i)
	{
		column.mask = LVCF_TEXT;
		column.pszText = szGenericColumnText[i];

		ListView_InsertColumn(m_hListViewBaseRelocTable, i, &column);
	}

	tabsBaseRelocations_OnTabChanged(m_hWnd, 0);
}
开发者ID:killbug2004,项目名称:PEPropPageExt,代码行数:28,代码来源:PropertyPageHandler_BaseReloc.cpp

示例14: initDialog

BOOL initDialog(HWND hWnd)
{
	HICON   hIcon;
	TC_ITEM tci;
	int     i;

	hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_APP_ICON));
	SendMessage(hWnd, WM_SETICON, (LPARAM) ICON_BIG, (WPARAM) hIcon);
	hURLFont = 0;

	hWndTab = GetDlgItem(hWnd,IDC_TAB);

	ZeroMemory(&tci, sizeof(TC_ITEM));
	tci.mask        = TCIF_TEXT;
	for (i=0;i<NUM_TABS;i++) {
		tci.pszText = tabsName[i];
		if (TabCtrl_InsertItem(hWndTab, i, &tci) == -1) {
			PrintLastError("TabCtrl_InsertItem()");
			return FALSE;
		}
		hWndChild[i] = CreateDialogParam(hInst, MAKEINTRESOURCE(tabsResource[i]), hWndTab, (DLGPROC)TabDlgProc, 0);
	}

	hURLFont = CreateFont(20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH | FF_SWISS, "MS Shell Dlg");
	SendMessage(GetDlgItem(hWndChild[NUM_TABS-1], IDC_URL2), WM_SETFONT, (WPARAM)hURLFont, TRUE);

	currentTab = 0;
	ShowWindow(hWndChild[0], SW_SHOWDEFAULT);

	if (!openDevice(TRUE)) {
		PrintLastError("openDevice()");
		return FALSE;
	}
	return setDlgItems(hWnd);
}
开发者ID:hoangduit,项目名称:reactos,代码行数:35,代码来源:main.cpp

示例15: ZeroMemory

void TabControl::AddTabDialog(Dialog* dialog, wchar_t* title)
{
    HWND handle = dialog->GetDlgHandle();

    TCITEM tcItem;
    ZeroMemory (&tcItem,sizeof (tcItem));
    tcItem.mask			= TCIF_TEXT;
    tcItem.dwState		= 0;
    tcItem.pszText		= title;
    tcItem.cchTextMax	= (int)wcslen(tcItem.pszText)+1;
    tcItem.iImage		= 0;

    int index = TabCtrl_GetItemCount(hwnd);
    int result = TabCtrl_InsertItem(hwnd,index,&tcItem);

    RECT tabRect;
    GetWindowRect(hwnd,&tabRect);
    MapWindowPoints(HWND_DESKTOP,GetParent(hwnd),(LPPOINT)&tabRect,2);
    TabCtrl_AdjustRect(hwnd, FALSE, &tabRect);

    SetParent(handle,GetParent(hwnd));
    DWORD style = (GetWindowLong(handle,GWL_STYLE) | WS_CHILD) & ~(WS_POPUP | WS_TILEDWINDOW);
    SetWindowLong(handle, GWL_STYLE, style);
    MoveWindow(handle,tabRect.left,tabRect.top,tabRect.right-tabRect.left,tabRect.bottom-tabRect.top,TRUE);
    tabs.push_back(handle);

    ShowTab(index);
}
开发者ID:Gary1234567,项目名称:ppsspp,代码行数:28,代码来源:TabControl.cpp


注:本文中的TabCtrl_InsertItem函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。