How to disable the "close" button 
Author Message
 How to disable the "close" button

Does anyone know how to disable "close" button in Win-9x/NT.
TIA


Sat, 30 Mar 2002 03:00:00 GMT  
 How to disable the "close" button
"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).

trippz


Quote:
> Does anyone know how to disable "close" button in Win-9x/NT.
> TIA



Sun, 31 Mar 2002 03:00:00 GMT  
 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



Sun, 31 Mar 2002 03:00:00 GMT  
 How to disable the "close" button
The following code will not disable it (gray it out) but It will keep people
from closing by clicking X.

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = -1
End Sub

Quote:

>Does anyone know how to disable "close" button in Win-9x/NT.
>TIA



Sun, 31 Mar 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. disable "X" (close button) in ControlBox

2. Disabling "close button" in a form

3. Disabling "BACK"/"FORWARD" buttons

4. Disabling "BACK"/"FORWARD" buttons

5. Disable Application Quit ("X") Button

6. Disable "Add button" from toolbar

7. Disable the "Insert" Button

8. How to disable "PrintScreen" button

9. Disable "Back" Button

10. How to disable the "Back" button

11. Prevent Close ("X") Button under 95

12. disable close button without disabling make small button

 

 
Powered by phpBB® Forum Software