En supposant que tu soies sous Windows, exécute : Démarrer / Exécuter / Excel /regserver
-- Cordialement. Daniel "olitoto" a écrit dans le message de news:
Bonjour à tous,
J'ai une veille version d'excel, et je n'ai plus les boutons en haut à droite, de fermeture , réduction et passage en mode fenêtre.
je voudrais les rétablir.
Merci d'avance,
Olivier
michdenis
'1 - Enlève les boutons et inhibe le bouton de fermeture de l'application '2 - Fait disparaître le menus de l'icône excel de la barre de titre '3 - La barre de titre demeure toujours présente. '4 - Pour tout masquer, exécuter la procédure : ' Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes() '5 - Pour remettre tout en place, Exécuter la procédure : ' Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes() '6 - Et pour empêcher le redimensionnement de la feuille de calcul, ' il y a toujours la commande : Menu / outils / Protéger le classeur / fenêtre
Private Declare Function FindWindowA Lib "user32" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Private Declare Function GetClassLong Lib "user32" _ Alias "GetClassLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long
Private Declare Function SetClassLong Lib "user32" _ Alias "SetClassLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, _ ByVal bRevert As Integer) As Integer
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _ ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) _ As Long
Sub Disable_Control() Dim X As Integer For X = 1 To 9 Call DeleteMenu(GetSystemMenu(Application.hWnd, False), 0, 1024) Next X End Sub
Sub RestoreSystemMenu() hMenu% = GetSystemMenu(Application.hWnd, 1) End Sub
Sub HideMinimizeAndMaximizeButtons() Dim L As Long L = GetWindowLong(Application.hWnd, GWL_STYLE) L = L And Not (WS_MINIMIZEBOX) L = L And Not (WS_MAXIMIZEBOX) L = SetWindowLong(Application.hWnd, GWL_STYLE, L) End Sub
Sub RestoreMinimizeAndMaximizeButtons() Dim L As Long L = GetWindowLong(Application.hWnd, GWL_STYLE) L = SetWindowLong(Application.hWnd, GWL_STYLE, WS_MINIMIZEBOX _ Or WS_MAXIMIZEBOX Or L) End Sub
Sub RestaureLaCroix() Dim LeHandleExcel As Long Const GCL_STYLE = (-26) Const CS_NOCLOSE = &H200 LeHandleExcel = FindWindowA("XLMAIN", Application.Caption) SetClassLong LeHandleExcel, GCL_STYLE, _ GetClassLong(LeHandleExcel, GCL_STYLE) _ Xor CS_NOCLOSE End Sub
Sub EnleveLaCroix() Dim LeHandleExcel As Long Const GCL_STYLE = (-26) Const CS_NOCLOSE = &H200 LeHandleExcel = FindWindowA("XLMAIN", Application.Caption) SetClassLong LeHandleExcel, GCL_STYLE, _ GetClassLong(LeHandleExcel, GCL_STYLE) _ Xor CS_NOCLOSE End Sub
Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes()
Call Disable_Control Call HideMinimizeAndMaximizeButtons Call EnleveLaCroix End Sub
Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes() Call RestoreSystemMenu Call RestoreMinimizeAndMaximizeButtons Call RestaureLaCroix End Sub
"olitoto" a écrit dans le message de news:
Bonjour à tous,
J'ai une veille version d'excel, et je n'ai plus les boutons en haut à droite, de fermeture , réduction et passage en mode fenêtre.
je voudrais les rétablir.
Merci d'avance,
Olivier
'1 - Enlève les boutons et inhibe le bouton de fermeture de l'application
'2 - Fait disparaître le menus de l'icône excel de la barre de titre
'3 - La barre de titre demeure toujours présente.
'4 - Pour tout masquer, exécuter la procédure :
' Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes()
'5 - Pour remettre tout en place, Exécuter la procédure :
' Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes()
'6 - Et pour empêcher le redimensionnement de la feuille de calcul,
' il y a toujours la commande : Menu / outils / Protéger le classeur /
fenêtre
Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetClassLong Lib "user32" _
Alias "GetClassLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetClassLong Lib "user32" _
Alias "SetClassLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, _
ByVal bRevert As Integer) As Integer
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _
ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) _
As Long
Sub Disable_Control()
Dim X As Integer
For X = 1 To 9
Call DeleteMenu(GetSystemMenu(Application.hWnd, False), 0, 1024)
Next X
End Sub
Sub RestoreSystemMenu()
hMenu% = GetSystemMenu(Application.hWnd, 1)
End Sub
Sub HideMinimizeAndMaximizeButtons()
Dim L As Long
L = GetWindowLong(Application.hWnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX)
L = L And Not (WS_MAXIMIZEBOX)
L = SetWindowLong(Application.hWnd, GWL_STYLE, L)
End Sub
Sub RestoreMinimizeAndMaximizeButtons()
Dim L As Long
L = GetWindowLong(Application.hWnd, GWL_STYLE)
L = SetWindowLong(Application.hWnd, GWL_STYLE, WS_MINIMIZEBOX _
Or WS_MAXIMIZEBOX Or L)
End Sub
Sub RestaureLaCroix()
Dim LeHandleExcel As Long
Const GCL_STYLE = (-26)
Const CS_NOCLOSE = &H200
LeHandleExcel = FindWindowA("XLMAIN", Application.Caption)
SetClassLong LeHandleExcel, GCL_STYLE, _
GetClassLong(LeHandleExcel, GCL_STYLE) _
Xor CS_NOCLOSE
End Sub
Sub EnleveLaCroix()
Dim LeHandleExcel As Long
Const GCL_STYLE = (-26)
Const CS_NOCLOSE = &H200
LeHandleExcel = FindWindowA("XLMAIN", Application.Caption)
SetClassLong LeHandleExcel, GCL_STYLE, _
GetClassLong(LeHandleExcel, GCL_STYLE) _
Xor CS_NOCLOSE
End Sub
Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes()
Call Disable_Control
Call HideMinimizeAndMaximizeButtons
Call EnleveLaCroix
End Sub
Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes()
Call RestoreSystemMenu
Call RestoreMinimizeAndMaximizeButtons
Call RestaureLaCroix
End Sub
"olitoto" <trucmuche@invalid.pf> a écrit dans le message de news:
uYz5FLdMJHA.4248@TK2MSFTNGP03.phx.gbl...
Bonjour à tous,
J'ai une veille version d'excel, et je n'ai plus les boutons en haut à
droite, de fermeture , réduction et passage en mode fenêtre.
'1 - Enlève les boutons et inhibe le bouton de fermeture de l'application '2 - Fait disparaître le menus de l'icône excel de la barre de titre '3 - La barre de titre demeure toujours présente. '4 - Pour tout masquer, exécuter la procédure : ' Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes() '5 - Pour remettre tout en place, Exécuter la procédure : ' Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes() '6 - Et pour empêcher le redimensionnement de la feuille de calcul, ' il y a toujours la commande : Menu / outils / Protéger le classeur / fenêtre
Private Declare Function FindWindowA Lib "user32" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long
Private Declare Function GetClassLong Lib "user32" _ Alias "GetClassLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long
Private Declare Function SetClassLong Lib "user32" _ Alias "SetClassLongA" _ (ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, _ ByVal bRevert As Integer) As Integer
Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Integer, _ ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) _ As Long
Sub Disable_Control() Dim X As Integer For X = 1 To 9 Call DeleteMenu(GetSystemMenu(Application.hWnd, False), 0, 1024) Next X End Sub
Sub RestoreSystemMenu() hMenu% = GetSystemMenu(Application.hWnd, 1) End Sub
Sub HideMinimizeAndMaximizeButtons() Dim L As Long L = GetWindowLong(Application.hWnd, GWL_STYLE) L = L And Not (WS_MINIMIZEBOX) L = L And Not (WS_MAXIMIZEBOX) L = SetWindowLong(Application.hWnd, GWL_STYLE, L) End Sub
Sub RestoreMinimizeAndMaximizeButtons() Dim L As Long L = GetWindowLong(Application.hWnd, GWL_STYLE) L = SetWindowLong(Application.hWnd, GWL_STYLE, WS_MINIMIZEBOX _ Or WS_MAXIMIZEBOX Or L) End Sub
Sub RestaureLaCroix() Dim LeHandleExcel As Long Const GCL_STYLE = (-26) Const CS_NOCLOSE = &H200 LeHandleExcel = FindWindowA("XLMAIN", Application.Caption) SetClassLong LeHandleExcel, GCL_STYLE, _ GetClassLong(LeHandleExcel, GCL_STYLE) _ Xor CS_NOCLOSE End Sub
Sub EnleveLaCroix() Dim LeHandleExcel As Long Const GCL_STYLE = (-26) Const CS_NOCLOSE = &H200 LeHandleExcel = FindWindowA("XLMAIN", Application.Caption) SetClassLong LeHandleExcel, GCL_STYLE, _ GetClassLong(LeHandleExcel, GCL_STYLE) _ Xor CS_NOCLOSE End Sub
Sub ProcedureGeneral_EnleverLesBoutons_Et_Commandes()
Call Disable_Control Call HideMinimizeAndMaximizeButtons Call EnleveLaCroix End Sub
Sub ProcedureGeneral_RemettreLesBoutons_Et_Commandes() Call RestoreSystemMenu Call RestoreMinimizeAndMaximizeButtons Call RestaureLaCroix End Sub
"olitoto" a écrit dans le message de news:
Bonjour à tous,
J'ai une veille version d'excel, et je n'ai plus les boutons en haut à droite, de fermeture , réduction et passage en mode fenêtre.