How to use MF_BYPOSITION parameter in InsertMenu Function
-
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!
-
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!
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."
-
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."
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); -
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);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."
-
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!
-
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."
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