views:

36

answers:

1

Hello! I have pop-up menu, for example:

  • "..."
  • "PopUp-menu"
    • "Menuitem1"
    • "Menuitem2"
  • "..."

How to popup "PopUp-menu" using SendMessage function? Is it possible? course Menuitem has ID, and POPUP menu - has not

+1  A: 

the "ID" of a popup menu is its handle, but it's not clear what you mean by "popup the menu using SendMessage". What you would normally do is to get the handle of the "PopUp-Menu" and then pass that to TrackPopupMenu rather than SendMessage.

John Knoeller
Maybe I was wrong using PopUp term. I mean, that I have menu with subitems, I can open this menu and show its subitems using mouse cursor, but I want to open this menu and show subitems using SendCommand. Is it possible?
Not reliably, the first time the user moves the mouse the menu will respond to the mouse rather than to your messages. Also, once you show a menu, you don't really have a place to hang the code to do the SendMessage anyway. your code doesn't get control back until the menu is dismissed.
John Knoeller