Create a new .exe project and in
the load event of form1 put:
Const MF_BYPOSITION = &H400
Private Declare Function GetSystemMenu Lib "User32" _
(ByVal hWnd As Long, ByVal bRevert _
As Long) As Long
Private Declare Function RemoveMenu Lib "User32" _
(ByVal hMenu As Long, ByVal nPosition _
As Long, ByVal wFlags As Long) As Long
Private Sub Form_Load()
RemoveMenu GetSystemMenu(Me.hWnd, 0), 6, MF_BYPOSITION
End Sub
Execute
the app. (F5) and you`ll see the X
("close") button is disabled
|