Click here to Skip to main content
15,887,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: index of HTREEITEM item? Pin
zon_cpp28-Sep-11 2:06
zon_cpp28-Sep-11 2:06 
GeneralRe: index of HTREEITEM item? Pin
Stefan_Lang28-Sep-11 4:52
Stefan_Lang28-Sep-11 4:52 
AnswerRe: index of HTREEITEM item? Pin
Maximilien28-Sep-11 2:52
Maximilien28-Sep-11 2:52 
GeneralRe: index of HTREEITEM item? Pin
Stefan_Lang28-Sep-11 4:54
Stefan_Lang28-Sep-11 4:54 
QuestionRe: index of HTREEITEM item? Pin
Code-o-mat28-Sep-11 9:57
Code-o-mat28-Sep-11 9:57 
AnswerRe: index of HTREEITEM item? Pin
Maximilien28-Sep-11 12:34
Maximilien28-Sep-11 12:34 
QuestionRe: index of HTREEITEM item? Pin
David Crow28-Sep-11 3:07
David Crow28-Sep-11 3:07 
AnswerRe: use LPARAM to get index Pin
Software_Developer28-Sep-11 3:10
Software_Developer28-Sep-11 3:10 
One way: you can pass index in LPARAM lParam argument when inserting items
in treeview; then use GetSelectedItem to get handle to selected tree item
and get it index with CTreeCtrl::GetItem .

C#
HTREEITEM hItem = m_treeFeature.GetSelectedItem();
TVITEM tvItem = {0};
tvItem.mask = TVIF_PARAM;
tvItem.hItem = hItem;
m_treeFeature.GetItem(&tvItem);
int nindex  = (int)tvItem.lParam;



HTREEITEM GetSelectedItem( )
http://msdn.microsoft.com/en-us/library/xw6h5d91(v=vs.80).aspx[^]
QuestionCRichEdit control Scrollbar issue in MFC Application Pin
Member 827069028-Sep-11 0:19
Member 827069028-Sep-11 0:19 
AnswerRe: CRichEdit control Scrollbar issue in MFC Application - Repost Pin
Richard MacCutchan28-Sep-11 3:50
mveRichard MacCutchan28-Sep-11 3:50 
QuestionSelectItem of CTreeCtrl Pin
zon_cpp27-Sep-11 23:44
zon_cpp27-Sep-11 23:44 
AnswerRe: SelectItem of CTreeCtrl Pin
Zasky28-Sep-11 0:41
Zasky28-Sep-11 0:41 
AnswerRe: SelectItem of CTreeCtrl Pin
Roger Allen29-Sep-11 0:34
Roger Allen29-Sep-11 0:34 
QuestionEnvironment for PIC programming Pin
CodingLover27-Sep-11 23:40
CodingLover27-Sep-11 23:40 
AnswerRe: Environment for PIC programming Pin
Software_Developer28-Sep-11 0:19
Software_Developer28-Sep-11 0:19 
GeneralRe: Environment for PIC programming Pin
CodingLover28-Sep-11 0:26
CodingLover28-Sep-11 0:26 
GeneralRe: Environment for PIC programming Pin
Software_Developer28-Sep-11 2:04
Software_Developer28-Sep-11 2:04 
GeneralRe: Environment for PIC programming Pin
CodingLover28-Sep-11 18:02
CodingLover28-Sep-11 18:02 
GeneralRe: Environment for PIC programming Pin
Albert Holguin29-Sep-11 3:34
professionalAlbert Holguin29-Sep-11 3:34 
AnswerRe: Environment for PIC programming Pin
castingflame28-Sep-11 4:18
castingflame28-Sep-11 4:18 
GeneralRe: Environment for PIC programming Pin
CodingLover28-Sep-11 18:07
CodingLover28-Sep-11 18:07 
QuestionWaitForSingleObject Pin
john563227-Sep-11 22:58
john563227-Sep-11 22:58 
AnswerRe: WaitForSingleObject Pin
Cedric Moonen28-Sep-11 1:21
Cedric Moonen28-Sep-11 1:21 
AnswerRe: WaitForSingleObject Pin
Code-o-mat28-Sep-11 4:37
Code-o-mat28-Sep-11 4:37 
GeneralRe: WaitForSingleObject Pin
Albert Holguin29-Sep-11 3:37
professionalAlbert Holguin29-Sep-11 3:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.