vbloverprogrammer
New member
- Joined
- Nov 25, 2022
- Messages
- 4
- Programming Experience
- 5-10
I have mainMenu at my own Resource-DLL and I put that to my Windows Form As MainMenu by API Methods: (LoadMenu and SetMenu)
How can I take MenuIDs After Clicking with WndProc?
This statement give the ID as Wrong.
How can I take MenuIDs After Clicking with WndProc?
Tried Code:
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = &H11F And m.LParam <> HMainMenu Then
If m.LParam <> 0 Then
MenuID = GetMenuItemID(m.LParam, 0)
Me.ListBox1.Items.Add("Selected.")
Else
Me.ListBox1.Items.Add("Clicked. " & MenuID.ToString)
End If
End If
MyBase.WndProc(m)
End Sub