Pirahnaplant
Well-known member
- Joined
- Mar 29, 2009
- Messages
- 75
- Programming Experience
- 3-5
How can I override the context menu that shows up when you right click on the title bar or the icon?
Private SysMenu As New SystemMenu(Me)
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = &H112 Then
Dim ids() As Integer = SysMenu.GetIDs()
RaiseEvent SysMenuItemClicked(SysMenu, New ItemClickedEventArgs(Array.IndexOf(ids, m.WParam.ToInt32)))
End If
MyBase.WndProc(m)
End Sub
Public Event SysMenuItemClicked(ByVal sender As Object, ByVal e As ItemClickedEventArgs)
Private SysMenu As New SystemMenu(Me)
Private Const WM_SYSCOMMAND As Integer = &H112
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_SYSCOMMAND Then
RaiseEvent SysMenuItemClicked(SysMenu, New ItemClickedEventArgs(SysMenu.ItemsID(m.WParam.ToInt32)))
End If
MyBase.WndProc(m)
End Sub
Public Event SysMenuItemClicked(ByVal sender As Object, ByVal e As ItemClickedEventArgs)