Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CTreeCtrl mouse click!

444 views
Skip to first unread message

Marina

unread,
Dec 19, 2001, 3:46:19 PM12/19/01
to

Is there a way in the LBUTTONDOWN event to know if the user clicked on the
button to expand the item, of the user just clicked on the item to select
it?


Thanks,

Marina


Baris Yazici

unread,
Dec 19, 2001, 3:50:47 PM12/19/01
to
Why dont you handle one of the TVN_ITEMEXPANDING or TVN_ITEMEXPANDED events?

also TVN_SELCHANGING or TVN_SELCHANGED events can be used to get an event
when a new item is selected or just about when the selection is changing.


"Marina" <mari...@earthlink.net> wrote in message
news:e40y93MiBHA.2608@tkmsftngp04...

Ajay Kalra

unread,
Dec 19, 2001, 3:50:38 PM12/19/01
to
You can use TreeView_HitTest to determine this.

--
Ajay Kalra [MVP - VC++]
ajay...@yahoo.com

Note: Please post all replies to newsgroup only.

"Marina" <mari...@earthlink.net> wrote in message
news:e40y93MiBHA.2608@tkmsftngp04...
>

Marina

unread,
Dec 19, 2001, 3:56:12 PM12/19/01
to
Because I am trying to implement multiple selection in the tree + some other
custom behavior.
But I don't want to select or deselect an item when the user clicks on the
button to expand it. So, is there a way to know where the user clicked?


"Baris Yazici" <barisNO...@avalist.com> wrote in message
news:g57U7.60921$m8.2...@news.webusenet.com...

Thomas Mooney

unread,
Dec 19, 2001, 3:55:27 PM12/19/01
to
Yes, take a look at CTreeCtrl::HitTest(...). It is worth noting that there
is a bit of misleading information in my documentation. Regarding the flags
parameter the documentation states "It can be one or more of the values
listed under the flags member in the Remarks section." In my documentation
it is ncessesary to follow the link to the TVHITTESTINFO structure to get
the enumeration of the flag values. The two values you're most interested
in are probably TVHT_ONITEM and TVHT_ONITEMBUTTON. It is, of course,
possible that the user clicks in places other than on the item or its
button.

TFM3

Note: Spam-resistant e-mail address


Marina <mari...@earthlink.net> wrote in message
news:e40y93MiBHA.2608@tkmsftngp04...
>

dave h

unread,
Dec 19, 2001, 4:38:30 PM12/19/01
to
Have a look here :
http://www.codeguru.com/treeview/CMultiTree.shtml
http://www.codeguru.com/treeview/multiple_sel.shtml

The codeguru site has tons of great information and code.

http://www.codeproject.com is another source, but I don't remember seeing
anything on a multi-selection treecontrol.

dave h

Marina <mari...@earthlink.net> wrote in message

news:O#Y0d9MiBHA.2212@tkmsftngp03...

0 new messages