XL 2016 Masquer l'icône excel de la barre des titres

ange1996

XLDnaute Nouveau
Bien le bonjour
J'ai réussi à masquer le ruban d'excel mais l'icône excel est toujours présent dans la barre des titres.
Existe t il un moyen de masquer l'icône excel de la barre des titres???
Je vous remercie d'avance pour vos précieuses réponses
 

job75

XLDnaute Barbatruc
Bonjour ange1996, bienvenue sur XLD,

Chez moi sur Win 10 - Excel 2013 quand je masque le ruban (par l'icône en haut à droite) le nom de la fenêtre n'est plus affiché.

Par contre la barre avec la croix de fermeture reste affichée, heureusement.

A+
 

Staple1600

XLDnaute Barbatruc
Bonjour le fi, ange1996, job75

Un code de PMO
(testé sur un viel Excel)
Je vous laisse tester sur XL2007 et supérieur.
(si 64bits, cf PtrSafe)
VB:
Option Explicit
         
        '### Apis ###
        Declare Function SetWindowLong& Lib "user32" Alias "SetWindowLongA" ( _
          ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
         
        Private Declare Function GetWindowLong& Lib "user32" Alias "GetWindowLongA" ( _
          ByVal Hwnd As Long, ByVal nIndex As Long)
         
        Declare Function SetWindowPos& Lib "user32" ( _
          ByVal Hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _
          ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
         
        Declare Function GetWindowRect& Lib "user32" (ByVal Hwnd As Long, lpRect As structRECT)
         
        '### Constantes ###
        '--- GetWindowLong ---
        Const GWL_STYLE = (-16)
        Const WS_CAPTION = &HC00000
        Const WS_MAXIMIZEBOX = &H10000
        Const WS_MINIMIZEBOX = &H20000
        Const WS_SYSMENU = &H80000
        '--- SetWindowPos ---
        Const SWP_FRAMECHANGED = &H20
        Const SWP_DRAWFRAME = SWP_FRAMECHANGED
        Const SWP_HIDEWINDOW = &H80
        Const SWP_NOACTIVATE = &H10
        Const SWP_NOCOPYBITS = &H100
        Const SWP_NOMOVE = &H2
        Const SWP_NOOWNERZORDER = &H200
        Const SWP_NOREDRAW = &H8
        Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
        Const SWP_NOSIZE = &H1
        Const SWP_NOZORDER = &H4
        Const SWP_SHOWWINDOW = &H40
        '--- GetWindowRect ---
        Private Type structRECT
          Left As Long
          Top As Long
          Right As Long
          Bottom As Long
        End Type
         
        Sub DemasqueTitreAppli()
        Call SwitchMasque(True)
        End Sub
         
        Sub MasqueTitreAppli()
        Call SwitchMasque(False)
        End Sub
         
        Sub SwitchMasque(bool As Boolean)
        Dim Style&
        Dim Rect As structRECT
        Dim Hwnd&
        Hwnd& = Application.Hwnd
        GetWindowRect Hwnd&, Rect
        '---
        Style& = GetWindowLong(Hwnd&, GWL_STYLE)
        If Not bool Then
          Style& = Style& And Not WS_SYSMENU
          Style& = Style& And Not WS_MAXIMIZEBOX
          Style& = Style& And Not WS_MINIMIZEBOX
          Style& = Style& And Not WS_CAPTION
        Else
          Style& = Style& Or WS_SYSMENU
          Style& = Style& Or WS_MAXIMIZEBOX
          Style& = Style& Or WS_MINIMIZEBOX
          Style& = Style& Or WS_CAPTION
        End If
        SetWindowLong Hwnd&, GWL_STYLE, Style&
        '---
        With Rect
          SetWindowPos Hwnd&, 0, .Left, .Top - 25, .Right - .Left, .Bottom - .Top + 25, _
              SWP_NOREPOSITION Or SWP_NOZORDER Or SWP_FRAMECHANGED
        End With
        End Sub
 

Discussions similaires

Réponses
2
Affichages
158

Statistiques des forums

Discussions
312 198
Messages
2 086 146
Membres
103 130
dernier inscrit
FRCRUNGR