Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to use MF_BYPOSITION parameter in InsertMenu Function

How to use MF_BYPOSITION parameter in InsertMenu Function

Scheduled Pinned Locked Moved C#
visual-studiocomtutorial
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Loithuxua
    wrote on last edited by
    #1

    Please tell me How to use MF_BYPOSITION parameter in InsertMenu Function. Link to MSDN: http://msdn.microsoft.com/en-us/library/ms647987%28v=vs.85%29.aspx[^] I some projects, I see: public const Int32 MF_BYPOSITION = 0x400; Can I use a different value for MF_BYPOSITION. Thanks alot!

    OriginalGriffO L 2 Replies Last reply
    0
    • L Loithuxua

      Please tell me How to use MF_BYPOSITION parameter in InsertMenu Function. Link to MSDN: http://msdn.microsoft.com/en-us/library/ms647987%28v=vs.85%29.aspx[^] I some projects, I see: public const Int32 MF_BYPOSITION = 0x400; Can I use a different value for MF_BYPOSITION. Thanks alot!

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Given that this is the C# forum, I'm going to say "no". Mainly because the link doesn't refer to C# code, but C++. You can't use that code in C#, and you shouldn't use it in C++ because - as it says at the top of the article - the function that refers to it has been superseded...

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      D D 2 Replies Last reply
      0
      • OriginalGriffO OriginalGriff

        Given that this is the C# forum, I'm going to say "no". Mainly because the link doesn't refer to C# code, but C++. You can't use that code in C#, and you shouldn't use it in C++ because - as it says at the top of the article - the function that refers to it has been superseded...

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

        D Offline
        D Offline
        David1987
        wrote on last edited by
        #3

        OriginalGriff wrote:

        You can't use that code in C#

        You sure?

        [DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)]
        static extern bool InsertMenu(IntPtr hmenu, uint position, uint flags,
        uint item_id, [MarshalAs(UnmanagedType.LPTStr)]string item_text);

        OriginalGriffO 1 Reply Last reply
        0
        • D David1987

          OriginalGriff wrote:

          You can't use that code in C#

          You sure?

          [DllImport("user32", SetLastError = true, CharSet = CharSet.Auto)]
          static extern bool InsertMenu(IntPtr hmenu, uint position, uint flags,
          uint item_id, [MarshalAs(UnmanagedType.LPTStr)]string item_text);

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Yes, ok, Mr Picky! :laugh: I was trying to simplify for a beginner that he was going the wrong way...

          Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • L Loithuxua

            Please tell me How to use MF_BYPOSITION parameter in InsertMenu Function. Link to MSDN: http://msdn.microsoft.com/en-us/library/ms647987%28v=vs.85%29.aspx[^] I some projects, I see: public const Int32 MF_BYPOSITION = 0x400; Can I use a different value for MF_BYPOSITION. Thanks alot!

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            You need more API functions than "InsertMenu" for Manipulating the System Menu Using C# So Here you go Simple Class to do this[^]

            I know nothing , I know nothing ...

            1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              Given that this is the C# forum, I'm going to say "no". Mainly because the link doesn't refer to C# code, but C++. You can't use that code in C#, and you shouldn't use it in C++ because - as it says at the top of the article - the function that refers to it has been superseded...

              Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Manfred R. Bihy: "Looks as if OP is learning resistant."

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              OriginalGriff wrote:

              as it says at the top of the article - the function that refers to it has been superseded...

              Not entirely... keep reading the statement. You can still use InsertMenu, however, if you do not need any of the extended features of InsertMenuItem.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups