Click here to Skip to main content
15,896,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I had a tree view where i had populated it with some values.Now my Tree view has a Root node and a sub node for it and in turn the sub node consists of three child items and i had a button in a dialog beneath the tree view and when i select the sub node that had 3 child items i must get a copy of that which will be pointing out to the root node.

[+]America
.
.
[+]INDIA
..AP
..MP
..MH
and now when i select "INDIA" and press the button then i must be able to add a copy of that to "America" and which would look like,

[+]America
. .
. .
. .
. [+]INDIA
. ...AP
. ...MP
. ...MH
.
.
.
....[+]INDIA[2]
....AP[2]
....MP[2]
....MH[2]

This is what i have to get but when i am clicking the button it is just adding the INDIA and i was unable to get the child item i.e,(AP,MP,MH).

I am getting the current selected item by sending message using SendDlgItemMessage(hWnd,IDC_TREE,TVM_GETITEM,TVGN_CARET,(LPARAM)&tvItem);

I tried getting the child item by sending one more message i.e,

SendDlgItemMessage(hWnd,IDC_TREE,TVM_GETITEM,TVGN_CHILD,(LPARAM)&tvItem);
but it is still showing the selected item but not the child items text value .

As i am new win32 programming got stuck over here .

Can anyone kindly help me .

Thanks in advance,
siva V
Posted
Comments
RajaPratap 21-May-14 5:10am    
Anyone there to help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900