youguybass
XLDnaute Junior
Bonjour tt le monde
Je cherche à ouvrir un userform en plein écran quelque soit la taille de l'écran, naturellement c'est un fichier partagé !
Sur mon poste aucun soucis mais sur des écrans + petit cela ne marche pas.
J'ai comme code:
Option Explicit
Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
et
Private Sub UserForm_Initialize()
Dim hwnd As Long, exLong As Long, zFactor As Integer
hwnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hwnd, -16)
If exLong And &H880000 Then SetWindowLongA hwnd, -16, exLong And &HFF77FFFF
zFactor = 100 * CInt(Application.Width / Me.Width)
Me.Width = Application.Width
Me.Height = Application.Height
End Sub
est-ce que quelqu'un aurait une solution ?
D'avance merci
Je cherche à ouvrir un userform en plein écran quelque soit la taille de l'écran, naturellement c'est un fichier partagé !
Sur mon poste aucun soucis mais sur des écrans + petit cela ne marche pas.
J'ai comme code:
Option Explicit
Private Declare PtrSafe Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
et
Private Sub UserForm_Initialize()
Dim hwnd As Long, exLong As Long, zFactor As Integer
hwnd = FindWindowA(vbNullString, Me.Caption)
exLong = GetWindowLongA(hwnd, -16)
If exLong And &H880000 Then SetWindowLongA hwnd, -16, exLong And &HFF77FFFF
zFactor = 100 * CInt(Application.Width / Me.Width)
Me.Width = Application.Width
Me.Height = Application.Height
End Sub
est-ce que quelqu'un aurait une solution ?
D'avance merci