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


C++ TreeView_GetItem函数代码示例

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


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

示例1: UpdateTocExpansionState

void UpdateTocExpansionState(TabInfo *tab, HWND hwndTocTree, HTREEITEM hItem)
{
    while (hItem) {
        TVITEM item;
        item.hItem = hItem;
        item.mask = TVIF_PARAM | TVIF_STATE;
        item.stateMask = TVIS_EXPANDED;
        TreeView_GetItem(hwndTocTree, &item);

        DocTocItem *tocItem = item.lParam ? (DocTocItem *)item.lParam : nullptr;
        if (tocItem && tocItem->child) {
            // add the ids of toggled items to tocState
            bool wasToggled = !(item.state & TVIS_EXPANDED) == tocItem->open;
            if (wasToggled)
                tab->tocState.Append(tocItem->id);
            UpdateTocExpansionState(tab, hwndTocTree, TreeView_GetChild(hwndTocTree, hItem));
        }

        hItem = TreeView_GetNextSibling(hwndTocTree, hItem);
    }
}
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:21,代码来源:TableOfContents.cpp

示例2: TreeView_GetSelection

CATTREEINFO* CATTreeCtrl::OSGetCurSel()
{
    HTREEITEM itemHndl = TreeView_GetSelection(fControlWnd);
    if (itemHndl == 0)
    {
        return 0;
    }
    TVITEM item;
    memset(&item,0,sizeof(item));
    item.hItem = itemHndl;
    item.mask = TVIF_PARAM;

    if (TreeView_GetItem(fControlWnd,&item))
    {
        CATTREEINFO* treeInfo = (CATTREEINFO*)item.lParam;
        return treeInfo;
    }

    CATASSERT(false,"Get selection failed, but something seems to be selected!");
    return 0;
}
开发者ID:michaelellison,项目名称:Mike-s-Demo-App,代码行数:21,代码来源:CATTreeCtrl_Win32.cpp

示例3: GoToTocLinkForTVItem

static void GoToTocLinkForTVItem(WindowInfo* win, HWND hTV, HTREEITEM hItem=nullptr, bool allowExternal=true)
{
    if (!hItem)
        hItem = TreeView_GetSelection(hTV);

    TVITEM item;
    item.hItem = hItem;
    item.mask = TVIF_PARAM;
    TreeView_GetItem(hTV, &item);
    DocTocItem *tocItem = (DocTocItem *)item.lParam;
    if (!tocItem || !win->IsDocLoaded())
        return;
    if ((allowExternal || tocItem->GetLink() && Dest_ScrollTo == tocItem->GetLink()->GetDestType()) || tocItem->pageNo) {
        // delay changing the page until the tree messages have been handled
        TabInfo *tab = win->currentTab;
        Controller *ctrl = win->ctrl;
        uitask::Post([=] {
            GoToTocLinkTask(win, tocItem, tab, ctrl);
        });
    }
}
开发者ID:kepazon,项目名称:my_sumatrapdf,代码行数:21,代码来源:TableOfContents.cpp

示例4: SaveBranch

static void SaveBranch(HWND hwndTree, branch_t *branch, int nValues)
{
    TVITEM tvi = { 0 };
    BYTE bChecked;
    DWORD iState = 0;

    for (int i = 0; i < nValues; i++) {
        tvi.mask = TVIF_HANDLE | TVIF_IMAGE;
        tvi.hItem = branch[i].hItem;
        TreeView_GetItem(hwndTree, &tvi);
        bChecked = ((tvi.iImage == IMG_CHECK) ? 1 : 0);
        if (branch[i].iMode) {
            if (bChecked)
                iState |= branch[i].iMode;
            if (iState & GC_EVENT_ADDSTATUS)
                iState |= GC_EVENT_REMOVESTATUS;
            db_set_dw(0, CHAT_MODULE, branch[i].szDBName, iState);
        }
        else db_set_b(0, CHAT_MODULE, branch[i].szDBName, bChecked);
    }
}
开发者ID:gloria8023,项目名称:miranda-ng,代码行数:21,代码来源:options.cpp

示例5: LoadItemText

int LoadItemText(HWND hwnd, HTREEITEM htreeItem, char *buf, int indent)
{
    TV_ITEM item;
    TCData *td;
    memset(&item, 0, sizeof(item));
    item.hItem = htreeItem;
    item.mask = TVIF_PARAM;
    TreeView_GetItem(hwnd, &item);
    td = (TCData*)item.lParam;
    if (td)
    {
        int size = strlen(td->col1Text) + indent;
        int n = 40 - size, i;
        if (n < 0)
            n = 0;
        if (td->col2Text)
        {
            size += n+1;
            size += strlen(td->col2Text);
        }
        size ++;
        if (buf)
        {
            for (i=0; i < indent; i++)
                strcat(buf, " ");
            strcat(buf, td->col1Text);
            if (td->col2Text)
            {
                for (i=0; i < n; i++)
                    strcat(buf, " ");
                    
                strcat(buf, " ");
                strcat(buf, td->col2Text);
            }
            strcat(buf, "\n");
        }
        return size;
    }
    return 0;
}
开发者ID:bencz,项目名称:OrangeC,代码行数:40,代码来源:ctltree.c

示例6: replaceTreeItem

void replaceTreeItem(HWND hwnd, MCONTACT hContact, const char *module, const char *newModule)
{
	int hItem = findItemInTree(hwnd, hContact, (char *)module);
	HTREEITEM hParent;

	if (hItem == -1)
		return;

	hParent = TreeView_GetParent(hwnd, (HTREEITEM)hItem);

	{
		TVITEM item;
		item.mask = TVIF_PARAM;
		item.hItem = (HTREEITEM)hItem;

		if (TreeView_GetItem(hwnd, &item))
			mir_free((ModuleTreeInfoStruct *)item.lParam);
		TreeView_DeleteItem(hwnd, item.hItem);
	}

	if (hParent && newModule) {
		TVINSERTSTRUCT tvi = {0};
		ModuleTreeInfoStruct *lParam;

		tvi.hParent = hParent;
		tvi.hInsertAfter = TVI_SORT;
		tvi.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
		tvi.item.pszText = (char *)newModule;

		lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
		lParam->hContact = hContact;
		lParam->type = KNOWN_MODULE;
		tvi.item.iImage = 1;
		tvi.item.iSelectedImage = 2;

		tvi.item.lParam = (LPARAM)lParam;

		TreeView_InsertItem(hwnd, &tvi);
	}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:40,代码来源:moduletree.cpp

示例7: OptTree_GetOptions

DWORD OptTree_GetOptions(HWND hwnd, int idcTree, OPTTREE_OPTION *options, int optionCount, char *szSettingName)
{
    enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED };

    HWND hwndTree = GetDlgItem(hwnd, idcTree);
    DWORD result = 0;
    int i;
    for (i = 0; i < optionCount; ++i)
    {
        if ((!options[i].szSettingName && !szSettingName) ||
                (options[i].szSettingName && szSettingName && !lstrcmpA(options[i].szSettingName, szSettingName)))
        {
            TVITEM tvi;
            tvi.mask = TVIF_HANDLE|TVIF_IMAGE;
            tvi.hItem = options[i].hItem;
            TreeView_GetItem(hwndTree, &tvi);
            if ((tvi.iImage == IMG_CHECK) || (tvi.iImage == IMG_RCHECK))
                result |= options[i].dwFlag;
        }
    }
    return result;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:22,代码来源:opttree.cpp

示例8: TreeView_GetChild

HTREEITEM BuildTree::FindChildItem(HTREEITEM hParent,const char *szItemText)
{
	HTREEITEM hItem = TreeView_GetChild(s_hWndTV,hParent);

	char szTemp[256];
	while(hItem != NULL)
	{
		TV_ITEM tvi = {0};
		tvi.mask = TVIF_TEXT;
		tvi.pszText = szTemp;
		tvi.cchTextMax = 255;
		tvi.hItem = hItem;
		TreeView_GetItem(s_hWndTV,&tvi);

		if (stricmp(tvi.pszText,szItemText) == 0)
		{
			return hItem;
		}
		hItem = TreeView_GetNextSibling(s_hWndTV,hItem);
	}
	return hItem;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:22,代码来源:BuildTree.cpp

示例9: TreeView_GetItem

void CMyTreeView::UpdateParent(HTREEITEM hParent)
{
	if(hParent != NULL)
	{
		TVITEM tvItem;
		SFGAOF Attributes = SFGAO_HASSUBFOLDER;
		BOOL bRes;
		HRESULT hr;

		tvItem.mask		= TVIF_PARAM|TVIF_HANDLE;
		tvItem.hItem	= hParent;
		bRes = TreeView_GetItem(m_hTreeView,&tvItem);

		if(bRes)
		{
			hr = GetItemAttributes(m_pItemInfo[static_cast<int>(tvItem.lParam)].pidl,
				&Attributes);

			if(SUCCEEDED(hr))
			{
				/* If the parent folder no longer has any sub-folders,
				set its number of children to 0. */
				if((Attributes & SFGAO_HASSUBFOLDER) != SFGAO_HASSUBFOLDER)
				{
					tvItem.cChildren = 0;
					TreeView_Expand(m_hTreeView,hParent,TVE_COLLAPSE);
				}
				else
				{
					tvItem.cChildren = 1;
				}

				tvItem.mask		= TVIF_CHILDREN;
				tvItem.hItem	= hParent;
				TreeView_SetItem(m_hTreeView,&tvItem);
			}
		}
	}
}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:39,代码来源:DirectoryModificationHandler.cpp

示例10: ATLASSERT

BOOL KUIMulStatusTree::GetCheck(HTREEITEM hItem, int& nCheck)
{
    ATLASSERT(m_hWnd != NULL);

    TV_ITEM tvi;
    ZeroMemory(&tvi, sizeof(tvi));

    tvi.hItem = hItem;
    tvi.mask = TVIF_STATE;
    tvi.stateMask = TVIS_STATEIMAGEMASK;
    if (!TreeView_GetItem(m_hWnd, &tvi))
        return FALSE;

    nCheck = tvi.state >> 12;

    if (nCheck < 0)
        return FALSE;

    ATLASSERT(nCheck >= EM_TVIS_NONE && nCheck <= EM_TVIS_CHECK);

    return TRUE;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:22,代码来源:kuimulstatustree.cpp

示例11: UndoSubItemChanges

void UndoSubItemChanges(HWND htv, HTREEITEM hItem, int cmd)
{
	TVITEM tvi = {0};
	tvi.mask = TVIF_HANDLE | TVIF_PARAM;
	tvi.hItem = hItem;
	TreeView_GetItem(htv, &tvi);

	TreeItem *treeItem = (TreeItem *)tvi.lParam;
	if (SECTIONPARAM_FLAGS(treeItem->value) & SECTIONPARAM_HAVEPAGE) {
		mir_cslock lck(csIconList);

		for (int indx = 0; indx < iconList.getCount(); indx++)
			if (iconList[ indx ]->section == sectionList[ SECTIONPARAM_INDEX(treeItem->value) ])
				UndoChanges(indx, cmd);
	}

	tvi.hItem = TreeView_GetChild(htv, tvi.hItem);
	while (tvi.hItem) {
		UndoSubItemChanges(htv, tvi.hItem, cmd);
		tvi.hItem = TreeView_GetNextSibling(htv, tvi.hItem);
	}
}
开发者ID:martok,项目名称:miranda-ng,代码行数:22,代码来源:skin2opts.cpp

示例12: GetTVitemSelList

//---------------------------------------------------//
// GetTVitemSelList
//---------------------------------------------------//
BOOL GetTVitemSelList(HWND hWndTV,HTREEITEM hItmStart,int StrIndex)
{	HTREEITEM hItm=hItmStart;
	TVITEM pitem;
	int index=0;
	char lpItmTxt[MAX_RS_SIZE]={0};
	pitem.pszText=lpItmTxt;
    pitem.mask=TVIF_TEXT;
	if(GetmHpVarStruct()->CourantTask->GetMultiIndex(StrIndex)==NULL) return TRUE;
	while(hItm!=NULL)
	{	GetmHpVarStruct()->SelItemListe->AddItemIndex(index);
		pitem.cchTextMax=MAX_RS_SIZE;
		pitem.hItem=hItm;
		TreeView_GetItem(hWndTV,&pitem);
		if(!strncmp(pitem.pszText,GetmHpVarStruct()->CourantTask->GetMultiIndex(StrIndex),MAX_RS_SIZE))
		{	if(GetTVitemSelList(hWndTV,TreeView_GetNextItem(hWndTV,hItm,TVGN_CHILD),(StrIndex+1))) return TRUE;
		}
		hItm=TreeView_GetNextItem(hWndTV,hItm,TVGN_NEXT);
		index++;
		GetmHpVarStruct()->SelItemListe->RemoveLastIndexItem();
	}
	return FALSE;
}
开发者ID:wyrover,项目名称:mHelp,代码行数:25,代码来源:TreeView.cpp

示例13: GetDlgItem

void CPpcFolderDlg::OnBtnDown(HWND hDlg, WPARAM wParam)
{
	TV_ITEM tvi;
	HWND hWnd = GetDlgItem(hDlg, IDC_TREE_FOLDER);
	HTREEITEM hItem = TreeView_GetSelection(hWnd);
	if (!hItem)
		return;

	memset(&tvi, 0, sizeof(tvi));
	tvi.mask = TVIF_CHILDREN | TVIF_STATE;
	tvi.hItem = hItem;
	TreeView_GetItem(hWnd, &tvi);

	if (tvi.cChildren) {
		if (wParam == VK_RIGHT) {
			if (!(tvi.state & TVIS_EXPANDED))
				TreeView_Expand(hWnd, hItem, TVE_EXPAND);
			else {
				hItem = TreeView_GetChild(hWnd, hItem);
				TreeView_SelectItem(hWnd, hItem);
			}
		}
		else {
			if (tvi.state & TVIS_EXPANDED)
				TreeView_Expand(hWnd, hItem, TVE_COLLAPSE);
			else {
				hItem = TreeView_GetParent(hWnd, hItem);
				TreeView_SelectItem(hWnd, hItem);
			}
		}
	}
	else {
		if (wParam == VK_LEFT) {
			hItem = TreeView_GetParent(hWnd, hItem);
			TreeView_SelectItem(hWnd, hItem);
		}
	}
}
开发者ID:afriza,项目名称:GSPlayer,代码行数:38,代码来源:PpcFolderDlg.cpp

示例14: LoadLibraryW

VOID
CDeviceView::DisplayPropertySheet()
{
#ifndef __REACTOS__
    pDevicePropertiesExW DevicePropertiesExW;
    HMODULE hModule;

    hModule = LoadLibraryW(L"devmgr.dll");
    if (hModule == NULL) return;

    DevicePropertiesExW = (pDevicePropertiesExW)GetProcAddress(hModule,
                                                               "DevicePropertiesExW");
    if (DevicePropertiesExW == NULL)
    {
        FreeLibrary(hModule);
        return;
    }
#endif

    TV_ITEM tvItem;

    tvItem.hItem = TreeView_GetSelection(m_hTreeView);
    tvItem.mask = TVIF_PARAM;

    if (TreeView_GetItem(m_hTreeView, &tvItem) &&
        (LPTSTR)tvItem.lParam != NULL)
    {
        DevicePropertiesExW(m_hTreeView,
                            NULL,
                            (LPTSTR)tvItem.lParam,
                            1,//DPF_EXTENDED,
                            FALSE);
    }

#ifndef __REACTOS__
    FreeLibrary(hModule);
#endif
}
开发者ID:RPG-7,项目名称:reactos,代码行数:38,代码来源:DeviceView.cpp

示例15: TreeView_GetItem

void 
FileTransfer::GetTVPath(HWND hwnd, HTREEITEM hTItem, char *path)
{
	char szText[rfbMAX_PATH];
	TVITEM _tvi;
	path[0] = '\0';
	do {
		_tvi.mask = TVIF_TEXT | TVIF_HANDLE;
		_tvi.hItem = hTItem;
		_tvi.pszText = szText;
		_tvi.cchTextMax = rfbMAX_PATH;
		TreeView_GetItem(hwnd, &_tvi);
		strcat(path, "\\");
		strcat(path, _tvi.pszText);
		hTItem = TreeView_GetParent(hwnd, hTItem);
	}
	while(hTItem != NULL);
	char path_tmp[rfbMAX_PATH], path_out[rfbMAX_PATH];
	path_tmp[0] = '\0';
	path_out[0] = '\0';
	int len = strlen(path);
	int ii = 0;
	for (int i = (len-1); i>=0; i--) {
		if (path[i] == '\\') {
			StrInvert(path_tmp);
			strcat(path_out, path_tmp);
			strcat(path_out, "\\");
			path_tmp[0] = '\0';
			ii = 0;
		} else {
			path_tmp[ii] = path[i];
			path_tmp[ii+1] = '\0';
			ii++;
		}
	}
	if (path_out[strlen(path_out)-1] == '\\') path_out[strlen(path_out)-1] = '\0';
	strcpy(path, path_out);
}
开发者ID:bk138,项目名称:CollabTool,代码行数:38,代码来源:FileTransfer.cpp


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