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


C++ TabCtrl_GetItem函数代码示例

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


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

示例1: TabCtrl_SwapItems

BOOL TabCtrl_SwapItems(HWND hTabCtrl, int iItem1, int iItem2)
{
	TCITEM tcItem;
	TCHAR szText1[512];
	tcItem.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE;
	tcItem.pszText = szText1;
	tcItem.cchTextMax = SIZEOF_ARRAY(szText1);
	BOOL bRet = TabCtrl_GetItem(hTabCtrl, iItem1, &tcItem);

	if(!bRet)
	{
		return FALSE;
	}

	LPARAM lParam1;
	int iImage1;
	lParam1 = tcItem.lParam;
	iImage1 = tcItem.iImage;

	TCHAR szText2[512];
	tcItem.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE;
	tcItem.pszText = szText2;
	tcItem.cchTextMax = SIZEOF_ARRAY(szText2);

	bRet = TabCtrl_GetItem(hTabCtrl, iItem2, &tcItem);

	if(!bRet)
	{
		return FALSE;
	}

	LPARAM lParam2;
	int iImage2;
	lParam2 = tcItem.lParam;
	iImage2 = tcItem.iImage;

	tcItem.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE;
	tcItem.pszText = szText1;
	tcItem.lParam = lParam1;
	tcItem.iImage = iImage1;
	bRet = TabCtrl_SetItem(hTabCtrl, iItem2, &tcItem);

	if(!bRet)
	{
		return FALSE;
	}

	tcItem.mask = TCIF_TEXT | TCIF_PARAM | TCIF_IMAGE;
	tcItem.pszText = szText2;
	tcItem.lParam = lParam2;
	tcItem.iImage = iImage2;
	bRet = TabCtrl_SetItem(hTabCtrl, iItem1, &tcItem);

	if(!bRet)
	{
		return FALSE;
	}

	return TRUE;
}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:60,代码来源:TabHelper.cpp

示例2: TR_ChangeTabControl

///////////////////////////////////////////////
// Tab control has changed : hide/show controls
LRESULT TR_ChangeTabControl (HWND hDlgWnd)
{
HWND   hTabWnd = GetDlgItem (hDlgWnd, IDC_TAB_OPTION);
DWORD  nCurOnglet = TabCtrl_GetCurSel (hTabWnd);
DWORD  Ark;
DWORD  TabMask;
TC_ITEM TabCtrlItem;

 // get the selected tab id
 if (nCurOnglet != (DWORD)-1)
   {
          TabCtrlItem.mask = TCIF_PARAM   ;
          TabCtrl_GetItem (hTabWnd, nCurOnglet, & TabCtrlItem);
          TabMask = MakeMask (TabCtrlItem.lParam);
   }
  else    TabMask = TAB_NONE;

 // according to TabMask and tResize table hide/display controls
 for (Ark=0 ; Ark<SizeOfTab(tResize) ; Ark++)
        ShowWindow (GetDlgItem (hDlgWnd, tResize[Ark].idCtrl),
                    (tResize[Ark].mView & TabMask) ? SW_SHOW : SW_HIDE);

  // DHCP tab has been selected : display the settings
  if (TabMask == TAB_DHCP_SERVER)
  {
	 Gui_LoadDHCPConfig (hDlgWnd);
  }

return TabCtrlItem.lParam ;
} // ChangeTabControl
开发者ID:madnessw,项目名称:thesnow,代码行数:32,代码来源:gui_move_win.c

示例3: Main_CreateTabDialog

HWND Main_CreateTabDialog (HWND hTab, size_t iTab)
{
   HWND hDlg = NULL;
   LPTSTR psz = NULL;

   TC_ITEM Item;
   memset (&Item, 0x00, sizeof(Item));
   Item.mask = TCIF_PARAM;
   if (TabCtrl_GetItem (hTab, iTab, &Item))
      {
      psz = (LPTSTR)(Item.lParam);
      }

   if (psz == dwTABPARAM_ADVANCED)    // Advanced tab
      {
      hDlg = ModelessDialog (IDD_TAB_ADVANCED, hTab, (DLGPROC)Advanced_DlgProc);
      }
   else if (psz == dwTABPARAM_MOUNT)  // Mount Points tab
      {
      hDlg = ModelessDialog (IDD_TAB_MOUNT, hTab, (DLGPROC)Mount_DlgProc);
      }
   else if (ISCELLTAB(psz) && !*psz)  // No Creds tab
      {
      hDlg = ModelessDialogParam (IDD_TAB_NOCREDS, hTab, (DLGPROC)Creds_DlgProc, (LPARAM)psz);
      }
   else if (ISCELLTAB(psz) && *psz)   // Creds tab for a particular cell
      {
      hDlg = ModelessDialogParam (IDD_TAB_CREDS, hTab, (DLGPROC)Creds_DlgProc, (LPARAM)psz);
      }

   return hDlg;
}
开发者ID:snktagarwal,项目名称:openafs,代码行数:32,代码来源:window.cpp

示例4: GetDlgItem

void CContainer::OnRenameTabInit(HWND hDlg)
{
	HWND	hEditName;
	TCITEM	tcItem;

	hEditName = GetDlgItem(hDlg,IDC_RENAMETAB_NEWTABNAME);

	tcItem.mask			= TCIF_PARAM;
	TabCtrl_GetItem(m_hTabCtrl,g_iTab,&tcItem);

	SetWindowText(hEditName,m_TabInfo[(int)tcItem.lParam].szName);

	g_EditNameEnabled = m_TabInfo[(int)tcItem.lParam].bUseCustomName;

	/* When this dialog is opened, the 'custom name' option will
	be selected by default (whether or not that is the actual
	option that is currently in effect). */
	CheckDlgButton(hDlg,IDC_RENAMETAB_USECUSTOMNAME,BST_CHECKED);

	EnableWindow(hEditName,TRUE);

	/* Select all the text in the name edit control. */
	SendMessage(hEditName,EM_SETSEL,0,-1);

	/* Focus on the name edit control. */
	SetFocus(hEditName);
}
开发者ID:yellowbigbird,项目名称:bird-self-lib,代码行数:27,代码来源:RenameTabDialog.cpp

示例5: TabToFront

int TabToFront(HWND TabWindow, int Index)
{
	assert(IsWindow(TabWindow));

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

	if(Index == -1)
		Index = 0;

	assert(Index >= 0);
	assert(Index < TabCtrl_GetItemCount(TabWindow));

	TC_ITEM TabData;
	TabData.mask = TCIF_PARAM;

	if(TabCtrl_GetItem(TabWindow, Index, &TabData))
	{
		ShowWindow(static_cast<HWND>(GetProp(TabWindow, PropName)), SW_HIDE);
		SetWindowPos(reinterpret_cast<HWND>(TabData.lParam), HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
		SetProp(TabWindow, PropName, reinterpret_cast<HANDLE>(TabData.lParam));
		TabCtrl_SetCurSel(TabWindow, Index);
		return Index;
	}
	return -1;
}
开发者ID:pezcode,项目名称:FireFly,代码行数:26,代码来源:tabs.cpp

示例6: GetChildFromTab

static struct MessageWindowData * GetChildFromTab(HWND hwndTabs, int tabId)
{
	TCITEM tci;
	tci.mask = TCIF_PARAM;
	TabCtrl_GetItem(hwndTabs, tabId, &tci);
	return (struct MessageWindowData *) tci.lParam;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:7,代码来源:msgwindow.c

示例7: TabCtrl_GetItemCount

void Explorerplusplus::SetTabIcon(int iTabId)
{
	LPITEMIDLIST pidl = NULL;
	TCITEM tcItem;
	int nTabs;
	int i = 0;

	pidl = m_pShellBrowser[iTabId]->QueryCurrentDirectoryIdl();

	nTabs = TabCtrl_GetItemCount(m_hTabCtrl);

	for(i = 0;i < nTabs;i++)
	{
		tcItem.mask = TCIF_PARAM;
		TabCtrl_GetItem(m_hTabCtrl,i,&tcItem);

		if((int)tcItem.lParam == iTabId)
		{
			SetTabIcon(i,iTabId,pidl);
			break;
		}
	}

	CoTaskMemFree(pidl);
}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:25,代码来源:HandleWindowState.cpp

示例8: show_tab_panel

static void
show_tab_panel(HWND hwnd,
               khui_config_node node,
               HWND hw_tab,
               int idx,
               BOOL show) {
    TCITEM tci;
    HWND hw;
    HWND hw_target;
    HWND hw_firstctl;
    RECT r;
    RECT rref;
    khui_config_node_reg reg;

    ZeroMemory(&tci, sizeof(tci));

    tci.mask = TCIF_PARAM;
    TabCtrl_GetItem(hw_tab,
                    idx,
                    &tci);

#ifdef DEBUG
    assert(tci.lParam);
#endif
    khui_cfg_get_reg((khui_config_node) tci.lParam, &reg);
    if (reg.flags & KHUI_CNFLAG_PLURAL)
        hw = khui_cfg_get_hwnd_inst((khui_config_node) tci.lParam,
                                    node);
    else
        hw = khui_cfg_get_hwnd((khui_config_node) tci.lParam);
#ifdef DEBUG
    assert(hw);
#endif

    if (!show) {
        ShowWindow(hw, SW_HIDE);
        return;
    }

    hw_target = GetDlgItem(hwnd, IDC_CFG_TARGET);
#ifdef DEBUG
    assert(hw_target);
#endif
    GetWindowRect(hwnd, &rref);
    GetWindowRect(hw_target, &r);

    OffsetRect(&r, -rref.left, -rref.top);

    SetWindowPos(hw,
                 hw_tab,
                 r.left, r.top,
                 r.right - r.left, r.bottom - r.top,
                 SWP_NOACTIVATE | SWP_NOOWNERZORDER |
                 SWP_SHOWWINDOW);

    hw_firstctl = GetNextDlgTabItem(hw, NULL, FALSE);
    if (hw_firstctl) {
        SetFocus(hw_firstctl);
    }
}
开发者ID:aosm,项目名称:Kerberos,代码行数:60,代码来源:cfg_identities_wnd.c

示例9: SiTabCtl_OnDrawItem

//重绘选项卡
void SiTabCtl_OnDrawItem(DRAWITEMSTRUCT* item)
{
	HBRUSH hBrush;
	TCITEM tci;
	char text[SI_BUF_SIZE];
	int type;

	memset(&tci,0,sizeof(TCITEM));
	tci.mask = TCIF_TEXT | TCIF_STATE;
	tci.pszText = (LPSTR)text;
	tci.cchTextMax = SI_BUF_SIZE;
	TabCtrl_GetItem(hwnd_tab_ctl,item->itemID,&tci);

	type = GetColorIndex(text);
	//创建颜色为hdc(窗口矩形)背景色的实画刷
	hBrush = CreateSolidBrush(color_table[type]);
	if(SiTabCtl_GetCurItem() == item->itemID)
	{
		hBrush = CreateSolidBrush(RGB(255,0,0));
	}
    //SetTextColor(lpDrawItem->hDC, RGB(0, 0, 255));
    //FrameRect(item->hDC,&item->rcItem,hBrush);
    FillRect(item->hDC,&item->rcItem,hBrush);
    DeleteObject(hBrush);
    SetBkMode(item->hDC,TRANSPARENT);
    DrawText(item->hDC,text,strlen(text),&item->rcItem,DT_CENTER|DT_LEFT|DT_VCENTER|DT_SINGLELINE);
}
开发者ID:cuiwm,项目名称:sihook,代码行数:28,代码来源:tabctl.c

示例10: RefreshRSP_RegProc

LRESULT CALLBACK RefreshRSP_RegProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) {
	int nSel;
	TC_ITEM item;

	switch( uMsg ) {
	case WM_PAINT:
		nSel = TabCtrl_GetCurSel( hTab );
		if ( nSel > -1 ) {
			item.mask = TCIF_PARAM;
			TabCtrl_GetItem( hTab, nSel, &item );
			switch( item.lParam ) {
			case GeneralPurpose:
				PaintRSP_GPRPanel (hWnd);
				break;
			case ControlProcessor0:
				PaintRSP_CP0Panel (hWnd);
				break;
			case HiddenRegisters:
				PaintRSP_HiddenPanel (hWnd);
				break;
			case Vector1:
				PaintRSP_Vector1_Panel (hWnd);
				break;
			case Vector2:
				PaintRSP_Vector2_Panel (hWnd);
				break;
			}

		}
		break;
	default:
		return( (*RefreshProc)(hWnd, uMsg, wParam, lParam) );
	}
	return( FALSE );
}
开发者ID:TwitchPlaysPokemon,项目名称:project64,代码行数:35,代码来源:RSP_Register.c

示例11: flags_HandleTabSwitch

static BOOL flags_HandleTabSwitch( HWND hDlg, LPNMHDR nmhdr )
{
	TCITEM		tcitem;
	HWND		edit;

	int i = TabCtrl_GetCurSel( nmhdr->hwndFrom );
	tcitem.mask = TCIF_PARAM;
	TabCtrl_GetItem( nmhdr->hwndFrom, i, &tcitem );
	edit = (HWND) tcitem.lParam;

	// The tab is right about to switch. Hide the current tab pane.
	if ( nmhdr->code == TCN_SELCHANGING )
	{
		ShowWindow( edit, SW_HIDE );
		SetWindowLongPtr( hDlg, DWLP_MSGRESULT, FALSE );
		return TRUE;
	}
	// The tab has just switched. Show the new tab pane.
	else if ( nmhdr->code == TCN_SELCHANGE )
	{
		ShowWindow ( edit, SW_SHOW );
		return TRUE;
	}
	else
		return FALSE;
}
开发者ID:WChrisK,项目名称:Zandronum,代码行数:26,代码来源:serverconsole_dmflags.cpp

示例12: mxTab_resizeChild

void mxTab_resizeChild (HWND hwnd)
{
	TC_ITEM ti;

	int index = TabCtrl_GetCurSel (hwnd);
	if (index >= 0)
	{
		ti.mask = TCIF_PARAM;
		TabCtrl_GetItem (hwnd, index, &ti);
		mxWidget *widget = (mxWidget *) ti.lParam;
		if (widget)
		{
			RECT rc, rc2;

			GetWindowRect (hwnd, &rc);
			ScreenToClient (GetParent (hwnd), (LPPOINT) &rc.left);
			ScreenToClient (GetParent (hwnd), (LPPOINT) &rc.right);

			TabCtrl_GetItemRect (hwnd, index, &rc2);

			int ex = GetSystemMetrics (SM_CXEDGE);
			int ey = GetSystemMetrics (SM_CYEDGE);
			rc.top += (rc2.bottom - rc2.top) + 3 * ey;
			rc.left += 2 * ex;
			rc.right -= 2 * ex;
			rc.bottom -= 2 * ey;
			HDWP hdwp = BeginDeferWindowPos (2);
			DeferWindowPos (hdwp, hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
			DeferWindowPos (hdwp, (HWND) widget->getHandle (), HWND_TOP, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW);
			EndDeferWindowPos (hdwp);
		}
	}
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:33,代码来源:mxtab.cpp

示例13: TabCtrl_GetItem

/**
 * popuplate the side bar with all sessions inside the current window. Information
 * is gathered from the tab control, which remains active (but invisible) when the
 * switch bar is in use.
 *
 * This is needed when the user switches from tabs to a switchbar layout while a
 * window is open.
 */
void CSideBar::populateAll()
{
	HWND	hwndTab = ::GetDlgItem(m_pContainer->hwnd, IDC_MSGTABS);
	if (hwndTab == NULL)
		return;

	int iItems = (int)TabCtrl_GetItemCount(hwndTab);

	TCITEM item = { 0 };
	item.mask = TCIF_PARAM;

	m_iTopButtons = 0;

	for (int i = 0; i < iItems; i++) {
		TabCtrl_GetItem(hwndTab, i, &item);
		if (item.lParam == 0 || !IsWindow((HWND)item.lParam))
			continue;

		TWindowData *dat = (TWindowData*)::GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
		if (dat == NULL)
			continue;

		CSideBarButton *b_item = findSession(dat);
		if (b_item == NULL)
			addSession(dat, i);
		else {
			b_item->setLayout(m_currentLayout);
			if (m_dwFlags & SIDEBARLAYOUT_VERTICALORIENTATION) {
				b_item->measureItem();
				m_topHeight += b_item->getHeight() + 1;
			}
			else m_topHeight += m_elementHeight + 1;
		}
	}
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:43,代码来源:sidebar.cpp

示例14: SiTabCtl_OnLButtonClk

//单击选项卡
void SiTabCtl_OnLButtonClk(void)
{
	int rtv;
	int idx = SiTabCtl_GetCurItem();
	int count = SiTabCtl_GetItemCount();
	if(idx != count)
		return;
	if(count == 0)
		return;

	rtv = MessageBox(hwnd_tab_ctl,"是否关闭所有标签?","sitab plugin by Red_angelX",MB_OKCANCEL|MB_ICONQUESTION|MB_DEFBUTTON2);
	if(rtv == IDCANCEL)
		return;

	while(count > 0)
	{
		HWND hwnd;
		TCITEM tci;
		memset(&tci,0,sizeof(TCITEM));
		tci.mask = TCIF_TEXT | TCIF_PARAM;
		TabCtrl_GetItem(hwnd_tab_ctl,count-1,&tci);
		hwnd = (HWND)tci.lParam;

		SendMessage(hwnd,WM_SYSCOMMAND,SC_CLOSE,0);
		count--;
	}
}
开发者ID:cuiwm,项目名称:sihook,代码行数:28,代码来源:tabctl.c

示例15: DockPanel_OnNotify

//
//	Called when the dockpanel receivees a WM_NOTIFY from one of its child-windows
//  i.e. either the TabView, or one of the DOCKWND's
//
LRESULT DockPanel_OnNotify(DOCKPANEL *dpp, WPARAM wParam, NMHDR *hdr)
{
	// notification message from the TabView
	if(hdr->hwndFrom == dpp->hwndTabView)
	{
		TCITEM tci = { TCIF_PARAM };
		DOCKWND *dwp;

		// get the active selection
		int iItem = TabCtrl_GetCurSel(dpp->hwndTabView);

		// every tab-item's lParam is a dockwindow-ID
		TabCtrl_GetItem(dpp->hwndTabView, iItem, &tci);

		switch(hdr->code)
		{
		case TCN_SELCHANGE:
			// show the appropriate DOCKWND
			DockWnd_Show(dpp->hwndMain, (UINT)tci.lParam, TRUE);
			break;

		case TCN_CLOSE:
			// hide the DOCKWND
			DockWnd_Show(dpp->hwndMain, (UINT)tci.lParam, FALSE);

			// delete the tab
			TabCtrl_DeleteItem(dpp->hwndTabView, iItem);
			break;

		case TCN_MOUSELEAVE:
			// the mouse has moved outside of the tab,
			// whilst being clicked - so we need to drag
			// the tab off into its own floating dock-window
			dwp = DOCKWNDFromId(dpp->hwndMain, (UINT)tci.lParam);
			
			if(dpp->WndListHead->flink == dwp && dpp->WndListTail->blink == dwp)
			{
				// if this is the last tab, then do a normal undock
				SendMessage(dpp->hwndTabView, WM_CANCELMODE, 0, 0);

				dpp->fUndockNextMsg = TRUE;
				DragOff(dpp);
			}
			else
			{
				// otherwise detach the tab and float it in a new DOCKPANEL
				UndockAndRemoveTab(dpp, (UINT)tci.lParam);
			}
			break;
		}

		return 0;
	}
	else
	{
		// forward it straight on
		return SendMessage(dpp->hwndMain, WM_NOTIFY, wParam, (LPARAM)hdr);
	}
}
开发者ID:4aiman,项目名称:HexEdit,代码行数:63,代码来源:DockWnd.c


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