Announcement

Collapse
No announcement yet.

Do not close POPUP menu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Do not close POPUP menu

    Hi
    I've created menu with popup menus.
    Some of Popup menus items are created as %MF_checked,
    obviously to check and uncheck the item.
    Is there a way that popup menu does not close when
    one of the items is checked or unchecked.
    Thanks
    Branko

    ------------------
    http://www.fg.uni-mb.si/lak/ocean


    Structural Engineering Software OCEAN2006
    Slovenia

  • #2
    hi everybody,

    I dont beleive there are no answers to my question
    (is it so straightforward or so complicated?)

    Branko

    ------------------
    http://www.fg.uni-mb.si/lak/ocean


    Structural Engineering Software OCEAN2006
    Slovenia

    Comment


    • #3
      Branko --
      of course, it's possible to set CBT hook, to retrive a handle of menu window, to subclass it and to prevent some messages.
      But much easy to analyze user's action and to display menu again.


      ------------------
      E-MAIL: [email protected]

      Comment


      • #4
        Branko --

        At a very low level, menus are much like buttons. When you select a menu item, it is like pressing a button and Windows assumes that you are done. So your question is similar to saying "I want to be able to detect when a user clicks a button so that I can change its appearance (add a check mark) but I don't want Windows to show the button being pressed and released."

        Windows does many thing automatically, but is sometimes possible to bypass those actions with subclassing (or in this case, possibly superclassing). You would need to intercept a certain message (I don't know which one, off hand), and then figure out which menu item was being clicked. If it was an item with a checkmark you would change the menu item to add or remove the check, and exit. If it was a "normal" menu item you would pass the message on to the default window proc.

        But... I usually discourage people from trying to change the way Windows "basic" controls such as menus work because it tends to confuse some users. A more traditional approach to your problem would be to have a single menu item (perhaps "Properties") that displays a dialog with several checkboxes and a "Done" button.

        -- Eric

        ------------------
        Perfect Sync: Perfect Sync Development Tools
        Email: mailto:[email protected][email protected]</A>

        [This message has been edited by Eric Pearson (edited November 23, 2000).]
        "Not my circus, not my monkeys."

        Comment


        • #5
          Eric,
          this is what I've done whilst waiting for the
          answers:
          I've created single menu item which displays
          Dialog with several check buttons.

          Thanks for help
          Branko

          ------------------
          http://www.fg.uni-mb.si/lak/ocean


          Structural Engineering Software OCEAN2006
          Slovenia

          Comment


          • #6
            Branko;

            If you have *many* checkbox items, then a ListView control with the %LVS_EX_CHECKBOXES custom style would do the trick perfectly.

            Regards,

            ------------------
            Kev G Peel
            KGP Software
            Bridgwater, United Kingdom.
            mailto:[email protected][email protected]</A>
            http://www.kgpsoftware.com

            Comment

            Working...
            X