|
 |
 |
 |
| |
 Remet le X de fermeture de programme
Paramètres en entrée : NOM (Form)
Paramètres en sortie : Aucun
Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Const MF_BYPOSITION = &H400&
Public Const MF_REMOVE = &H1000&
Public Sub RemetX (NOM As Form)
'********* Remet la X de la feuille voulue ***********
Dim hSysMenu As Long
Dim nCnt As Long
NOM.Show
hSysMenu = GetSystemMenu(NOM.hwnd, True)
If hSysMenu Then
nCnt = GetMenuItemCount(hSysMenu)
If nCnt Then
RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE
DrawMenuBar NOM.hwnd
End If
End If
NOM.Hide
NOM.Show
End Sub
|
|
 |
 |
 |
|