News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Right click menu

Started by ragdog, September 12, 2010, 11:29:06 AM

Previous topic - Next topic

ragdog

Hi


One menu item with two function

It is posiible by right click to get the menu item string?

My normal left click can i get with
invoke GetMenuString,hMenu,ID_1,addr hString,512,MF_BYCOMMAND

Now would like add to a menu item with two function
Left run my procedur and by right get this menu item string


.elseif uMsg==WM_RBUTTONUP
invoke GetCursorPos,addr Point
    invoke MenuItemFromPoint,hWnd,hMenu,Point.x,Point.y
    test eax,eax
    js @F
        mov ecx,eax
        invoke GetMenuString,hMenu,ecx,ADDR Buffer,260,MF_BYPOSITION
         invoke MessageBox, hWnd, ADDR Buffer, 0, MB_OK
    @@:



Thanks

Tedd

You get notified which item was selected, not how.
There are multiple ways to select a menu item, not just mouse clicking (this is especially necessary for alternative input devices and impaired users.)

That said, it's probably possible to do it anyway, though it would likely be messy.

In short, don't. It's a terrible interface - one menu item should do one thing. For two things, there should be two menu items.
No snowflake in an avalanche feels responsible.