
How to disable the "close" button
Quote:
> > Does anyone know how to disable "close" button in Win-9x/NT.
Quote:
> "close" button? if you mean the "X" in the top-right corner, the only way
> to disable that is it to set the form's ControlBox to False (which makes
> the Min, Max, and X disappear from the title).
Not the only way, it seems. Shah Bei posted the following on 1/10/99:
Yes, you can use API functions
Declare Function GetSystemMenu _
Lib "USER32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Declare Function RemoveMenu _
Lib "USER32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags
As Long) As Long
and constants
Public Const SC_CLOSE = &HF060
Public Const MF_BYCOMMAND = &H0&
to do it in your app
Dim hMyWndMenu as long
hMyWndMenu = GetSystemMenu(MyForm.hWnd, False)
RemoveMenu hMyWndMenu , SC_CLOSE, MF_BYCOMMAND
it will remove the X
Christina
--
C West