setting the behavior of the context popup menu
-
hi everybody, i had a sdi project, based on treeview. i want to setup context popup menu in such way so that the popup menu only pops up whenever the user right click on a node of the tree, sorta like how the popup menu works in windows explorer. any suggestion is welcome.. thanx in advance.
-
hi everybody, i had a sdi project, based on treeview. i want to setup context popup menu in such way so that the popup menu only pops up whenever the user right click on a node of the tree, sorta like how the popup menu works in windows explorer. any suggestion is welcome.. thanx in advance.
you will need to setup a handler for a message that is reflected from the tree view back to the parent. Check this message, NM_RCLICK. Then you need to use the tree controls hittest functions to determine if the mouse position is on one of the nodes in question. Once you have that you can display your context menu. Hope that helps. For more info search msdn for the NM_RCLICK message and also lookup message reflection for a broader overview of the topic. Good luck. Joseph Dempsey joseph_r_dempsey@yahoo.com "Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning." --anonymous