Option Explicit
Private Declare Function GetSystemMenu Lib "user32" _ (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, _ ByVal nPosition As Long, ByVal wFlags As Long) As Long Const MF_BYPOSITION = &H400& Private Sub MDIForm_Load() Dim hSysMenu As Long Dim lngResult As Long 'delete maximize hSysMenu = GetSystemMenu(Me.hwnd, False) '0 = restore '1 = move '2 = size '3 = maximize '4 = minimize lngResult = DeleteMenu(hSysMenu, 4, MF_BYPOSITION) If lngResult = 0 Then MsgBox "error; cannot delete menu item!" |