Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closable
Message
De
01/07/2002 14:07:45
 
 
À
01/07/2002 12:05:39
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00673937
Message ID:
00674023
Vues:
20
If you know anything about API function calls you can use them in order to hide, disable and so forth the title bar buttons ie minimize, maximize, and close along with the control box. I'll give you the code that I use in order to disable the close button.


'Put the following code in the main module (if you don't have a main module put it in
'whatever form is your startup form)
Public Const SC_CLOSE = &HF060&
Public Const SC_MAXIMIZE = &HF030&
Public Const SC_MINIMIZE = &HF020&
Public Const MF_BYCOMMAND = &H0&

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
'*******************************************************************************************

'Put the following code in the form that you want to disable or remove the button(s),Icon, or Control box
'ATTENTION the following code is only going to disable the close button and remove the close option in the
'control box. If you wish to do other thing you have to declare some other constants and functions.
Dim hSysMenu As Long
Dim RetVal As Long

'First gets the handle to the current form. Then removes/disables
'the close button.
hSysMenu = GetSystemMenu(Me.hwnd, 0) 'Returns a handle to the current form.
RetVal = RemoveMenu(hSysMenu, SC_CLOSE, MF_BYCOMMAND) 'Should return 1 if successful.
'*******************************************************************************************

I hope this helps you.
A great place to get some understanding of API calls and functions is www.vbapi.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform