You can also disable the X (close) button, along with the close item on the system menu, however this takes a little more work. You can use this code:
Private Declare Function DeleteMenu 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 Long, ByVal bRevert As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Sub Form_Load()
'// remove the close menu (which then disables the
close button)
RemoveMenus
End Sub
Private Sub RemoveMenus()
Dim hMenu As Long
' Get the form's system menu handle.
hMenu = GetSystemMenu(hWnd, False)
DeleteMenu hMenu, 6, MF_BYPOSITION
End Sub
Then, you would get a window like this (without the buttons and text, of course):
Comments