This is shorter way to disable the 'X' or close button on a form. It also works on MDI Child forms also which I have found most other code does not.
Inputs
None.
Assumes
Just copy and paste it as stated below!
Returns
None.
Side Effects
None.
API Declarations' Place this in a module:
Public Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const SC_CLOSE = &HF060&
Public Const MF_BYCOMMAND = &H0&