Hmmm guess I have to stop using the API guide as a resource. They list the wrong
declaration as well.
I still can't get this to work. Here is what I have for code, maybe you can tell
me what I'm doing wrong?
Thanks,
Bob
Public Class Form1
Inherits System.Windows.Forms.Form
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As _
IntPtr, ByVal nPosition As Integer, ByVal wFlags As Integer) As _
Boolean
''''old, bad declareation
'''Private Declare Function RemoveMenu Lib "user32" _
''' (ByVal hMenu As Long, ByVal nPosition As Long, _
''' ByVal wFlags As Long) As Long
'Private Declare Function GetSystemMenu Lib "user32" _
' (ByVal hwnd As Integer, ByVal bRevert As Boolean) As Integer
'Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" _
' (ByVal hMenu As Integer, ByVal wFlags As Integer, _
' ByVal wIDNewItem As Integer, ByVal lpNewItem As String) As Integer
'Private Const MF_BYPOSITION As Long = &H400
Private Const MF_REMOVE As Long = &H1000
'Private Const WM_SYSCOMMAND As Long = &H112
Private Sub Form1_Load _
(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim hSysMenu As Integer
'hSysMenu = GetSystemMenu(Me.Handle.ToInt32, False)
RemoveMenu(Me.Handle, 6, MF_REMOVE)
'AppendMenu(hSysMenu, 0, 1000, "New Item1")
'AppendMenu(hSysMenu, 0, 1001, "New Item2")
End Sub
'Protected Overrides Sub WndProc(ByRef m As Message)
' MyBase.WndProc(m)
' If m.Msg = WM_SYSCOMMAND Then
' Select Case m.WParam.ToInt32
' Case 1000
' MsgBox("Hello1")
' Case 1001
' MsgBox("Hello2")
' End Select
' End If
'End Sub
End Class