In a CMenu menu, WM_MENURBUTTONUP is only fired when the right mouse button is released while the mouse pointer is over a normal menu item (MF_STRING), but not if it's over a popup menu item (MF_POPUP). How can right-clicks on a popup menu item be detected? I'd like to implement a context menu for any menu item.
MFC: How to detect right-click on popup menu item?
170 Views Asked by stbi At
1
There are 1 best solutions below
Related Questions in MFC
- Cannot "Go To Definition" in Visual C++ 2013
- reset mdi child view position
- Add a picture to Picture Control in a dialog box (error RC2108: expected numerical dialog constant)
- Background color for controls in MFC C++ is unable to set
- variable global const "macros" in C++ and optimal design patterns
- Converting long double to CString
- postmessage and message loop in different thread
- How to convert CString to long? VC++
- Can a dialog intercept drag'n'drop messages passed to its controls?
- Can I close (note, not terminate) a user process from a service by its PID?
- How can I have a multi-line item in a ListControl MFC?
- Getting the messages back to the same command line from where the MFC application was launched
- MFC - How to set the toolbar title?
- MFC SetTitle() causing weird debug assertion
- Application logs on the command prompt from where application is being launched
Related Questions in POPUP
- How to not open the same Popup WPF MVVM?
- jQuery beforeunload custom pop up window for leaving a page
- How to get rid of popup ads?
- Pop Up with <a href=#modal> in java script
- How to redirect to another popup on ASP.NET MVC
- JavaFX PiChart, my hover values blink
- Rebind Mapbox popups after filtering
- Pop-up opens automatically
- How to create a pop-up login/register?
- Create Visual Notification Messages from Matlab in Windows, suitable for FileExchange (and without PowerShell)
- How to make app support Samsung's popup-view?
- on load open model popup using bootstrap?
- Insert iframe/object in popup issue
- jquery popup load from sql database on button click
- JSON - Make popup navigate to Google
Related Questions in RIGHT-CLICK
- How to enable right click option in JavaFX Pane?
- Catch result of process from exe (right click context)
- what is "Right click" keyboard shortcut in Chrome
- How do I select a Right Click Menu Item on Browser Menu with Protractor/Javascript?
- Java: why left click on a button is faster than right button
- Swift: NSStatusItem menu behaviour in 10.10 (e.g. show only on right mouse click)
- How to access system right click menus?
- Right controlClick on ToolbarWindow321 autohotkey
- How to enable right clicking using JavaScript?
- wxPython: Right-click with mouse does not set focus
- Excel VBA: Right click on a shape and add a new menu item
- click event in jQuery and right mouse clicking
- How can I have right-click on a cell of Java JList select that cell just like left-click does?
- Right Click on marker - Google Maps V3
- Java, coding right click functionality into the desktop
Related Questions in CMENU
- How can I resize an application menu bar in a MFC application?
- How can I assign a class to the unordered list created by Menu Widget in Yii?
- Yii Login Issues
- MFC: How do you add a bitmap to CMenu items added on OnInitMenuPopup?
- Is there an easier way to determine that none of the menu items are set to MF_CHECKED
- Handling dynamically populated CMenu messages
- Removing top level Menu item (in MFC). .
- C++ - MFC - Set height of CMenu
- CMenu border color on MFC
- CMenu replace item with submenu
- How can I show a checkbox in an owner-drawn MFC CMenu derived menu?
- How do I get system default checkbox BITMAP in VS2015?
- MFC : How to add tooltip in Cmenu items?
- Why can't I disable/gray out menuitem? (MFC)
- MFC: How to detect right-click on popup menu item?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I finally found a solution (or maybe a workaround) to detect and handle right-clicks on submenu items:
I defined message handlers for WM_MENUSELECT and WM_RBUTTONUP.
In OnMenuSelect() I store the Item Rect and the Item ID in two member variables of the dialog class:
In OnRButtonUp() I test if the mouse pointer is inside the stored Item Rect. If yes, I use the stored Item ID to open the shell context menu for the folder.
Working code can be found at https://github.com/fraktalfan/TrayMenu.