[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CtreeCtrl's child item

Posted on 1998-02-07
3
Medium Priority
?
957 Views
Last Modified: 2013-11-19
I would like to have sample codes to 'SetFocus' to a particular child item of a CTreeCtrl. The child info available is its item.lParam value.

Thanx.  
0
Comment
Question by:engllf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1315747
CTreeCtrl::SetItemState(hItem, TVIS_SELECTED, TVIF_STATE);
0
 

Author Comment

by:engllf
ID: 1315748
Hi,
As i have only the lParam value of the child item, i tried to get the hItem of the child item using the below code.  But i have problem with the GetItem() function.  It returns something that is not what i want. (I think the mask value is not set correctly.) BTW, I am using a CTreeView.

TV_ITEM TVItem ;
TVItem.lParam = (LPARAM) 1001 ; // i only know this lParam value
TVItem.mask = TVIF_PARAM ; //which flag needs to be included here?  

CTreeCtrl& MyTree = GetTreeCtrl() ;
if (MyTree.GetItem(&TVItem) ==  0)
{
    AfxMessageBox("error");
    return -1 ;
}

MyTree.SetItemState(TVItem.hItem, TVIS_SELECTED, TVIF_STATE) ;
0
 
LVL 1

Accepted Solution

by:
winmeister earned 150 total points
ID: 1315749
This is the code you need:

SetItemState(TVItem.hItem, TVIS_DROPHILITED | TVIS_SELECTED, TVIS_DROPHILITED | TVIS_SELECTED);

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question