Userform plein ecran sans barre des taches windows

bonjour

je souhaites avoir mes userform en pleine écran sans la barre des taches Windows.

le pleine écran c'est bon ( je pense ) reste a afficher sans windows et pouvoir afficher celle ci sur demande clic bouton

Bonsoir,

ci dessous un code trouvé sur le net (je ne connais plus ses références), toujours est-il que je le met partout !
Il permet de supprimer tout ce qu'il y a autour du USF, reste plus qu'un petit cadre. Attention ! Prévoir un bouton pour le fermer !

Option Explicit

'Pour enlever la barre de titre du UF
Public Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
End Type

Public Const GWL_STYLE = (-16)
Public Const WS_CAPTION = &HC00000
Public Const SWP_FRAMECHANGED = &H20

#If VBA7 Then
    Public Declare PtrSafe Function FindWindowA Lib "USER32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare PtrSafe Function GetWindowRect Lib "USER32" (ByVal hWnd As LongPtr, lpRect As RECT) As Long
    Public Declare PtrSafe Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As LongPtr) As Long
    Public Declare PtrSafe Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hWnd As LongPtr, ByVal nIndex As LongPtr, ByVal dwNewLong As LongPtr) As Long
    Public Declare PtrSafe Function SetWindowPos Lib "USER32" (ByVal hWnd As LongPtr, ByVal hWndInsertAfter As LongPtr, ByVal x As LongPtr, ByVal y As LongPtr, ByVal cx As LongPtr, ByVal cy As LongPtr, ByVal wFlags As LongPtr) As Long
#Else
    Public Declare Function FindWindowA Lib "USER32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Public Declare Function GetWindowRect Lib "USER32" (ByVal hWnd As Long, lpRect As RECT) As Long
    Public Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
    Public Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Public 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) As Long
#End If

Sub OteTitleBarre(stCaption As String, pbVisible As Boolean)
    Dim vrWin As RECT
    Dim style As Long
    Dim lHwnd As Long
    '- Recherche du handle de la fenêtre par son Caption
    lHwnd = FindWindowA(vbNullString, stCaption)
    If lHwnd = 0 Then
        MsgBox "Handle de " & stCaption & " Introuvable", vbCritical
        Exit Sub
    End If
    GetWindowRect lHwnd, vrWin
    style = GetWindowLong(lHwnd, GWL_STYLE)
    If pbVisible Then
        SetWindowLong lHwnd, GWL_STYLE, style Or WS_CAPTION
    Else
        SetWindowLong lHwnd, GWL_STYLE, style And Not WS_CAPTION
    End If
    SetWindowPos lHwnd, 0, vrWin.Left, vrWin.Top, vrWin.Right - vrWin.Left, _
    vrWin.Bottom - vrWin.Top, SWP_FRAMECHANGED
End Sub

Il reste de plus dans l'initialize du USF à faire appel à :

OteTitleBarre Me.Caption, False

Le True/False vous permet d'afficher la barre du haut ou pas

@ bientôt

LouReeD

voila pour le moment j'ai ceci

peut on afficher jusqu'en bas et désactive le bouton windows du menu démarrer

67masque-barre.xlsm (14.54 Ko)

le bouton windows

Rechercher des sujets similaires à "userform plein ecran barre taches windows"