Article ID: 118376
Article Last Modified on 12/9/2003
' Enter each Declare statement as one, single line:
Declare Function GetSystemMenu Lib "User" (ByVal hWnd%,
ByVal bRevert%) As Integer
Declare Function DeleteMenu Lib "user" (ByVal hMenu%, ByVal iditem%,
ByVal wflags%) As Integer
Const SC_SIZE = &HF000
Const SC_MOVE = &HF010
Const MF_BYCOMMAND = &H0
NOTE: Other constants to remove other menu items in the Control
menu are described in the WIN30API.TXT text file found in the
\VB\WINAPI directory.
Sub Command1_Click ()
Dim hWnd%, hMenu%, Success%
hWnd% = Form1.hWnd
hMenu% = GetSystemMenu(hWnd%, 0)
Success% = deletemenu(hMenu%, SC_SIZE, MF_BYCOMMAND)
Success% = deletemenu(hMenu%, SC_MOVE, MF_BYCOMMAND)
End Sub
82876 : How to Disable Close Command in VB Control Menu (System Menu)
Additional query words: 2.00 3.00
Keywords: KB118376