mfc >> How to handle context menu in tree view

by natko » Tue, 02 Dec 2003 17:40:36 GMT

Hi,
for some reason I cannot handle context menu in handler for WM_CONTEXTMENU
message. Actually, code executes when I double right click the mouse. This
problem only appears in CListView and view derived from it.

So I decided to handle NM_RCLICK notification but NMHDR structure is of no
help as it doesn't show coordinates where the click occured. But I solved
that problem.

My question is why I can't handle WM_CONTEXTMENU message with just one right
click?

natko




mfc >> How to handle context menu in tree view

by natko » Tue, 02 Dec 2003 23:10:22 GMT


Thanks for your help.

natko





Similar Threads

1. Context Menu - Microsofts standard file context menu - CSharp/C#

2. List View Context Menu

I have created a context menu for the listview and I wanno show the context 
menu if and only if a particular listviewitem is highlighted.

I used the following code

        private void contextLstContent_Opening(object sender, 
CancelEventArgs e)
        {
            if (lstContent.SelectedItems.Count < 1)
            {
                e.Cancel = true;
            }
        }

instead of doing like this want is I want to select/highlight the 
listviewitem pointed by the mouse pointer when right clicked and show the 
context menu.

any suggestions???

Regards
Rajkiran 

3. Capturing context menu by a view window

4. How would you handle context menu for TreeView?

If you have a tree view where particular nodes you want a context menu (right 
click menu) to show? It should only show for specific nodes, which are 
classes extending TreeNode

5. How do I enabled menu items when handling view not in focus

6. Switching between tree view and list view

Hello out there,
I need to display hierarchical data - somewhat similar to a file
system. There will be lots of items (10.000 or more).
Here is what the users want:
- Display as a tree (since its hierarchical),
- but also optionally display as flat list with a text search option,
- and the possibility to switch between the 2 views while keeping the
current position.

The idea behind these requirements is as follows:
- For users who are well aquainted with the structure of the data the
treeview will probably be the most efficient way to locate the item of
interest.
- For others which maybe only know the name of one particular item but
not its path a searchable list might make more sense.
- Finally the opton to switch between these 2 views: Item names will
have (lots of) duplicates. If someone knows the approximate path the
treeview may be good to home in into the region of interest and then
switching to the list view and use the search feature - or maybe the
other way round: users have different ways to accomplish their goals.

Currently I don't have a concrete idea how to approach this and
therefore any link or advice will be greatly appreciated.
Best regards
Helmut Giese

7. how i can get tree view in view window

8. populating tree view and list view

Hi, how do i populate a tree view to show all the drives on a system and how
to display the corresponding files and folders in a list view (ex.:
windows-explorer).
Thanx in advance.