Bonjour,
J'ai appliqué la FAQ "Comment détecter le changement de résolution de l'écran" :
Cependant, la résolution affichée
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Public Function WindowProc(ByVal HWnd As Long, ByVal msg As Long, _ ByVal wParam As Long, ByVal lParam As Long) As Long Dim X As Long, Y As Long If msg = WM_DISPLAYCHANGE Then 'la résolution a changé X = Screen.Width / Screen.TwipsPerPixelX 'résolution horizontale Y = Screen.Height / Screen.TwipsPerPixelY 'verticale frmParametres.lblResolutionEcran.Caption = X & " x " & Y End If 'Appelle la procédure de fenêtre par défaut pour que Windows puisse traiter l'évènement WindowProc = CallWindowProc(oldWndProc, HWnd, msg, wParam, lParam) End Functionest celle d'avant le changement !
Code : Sélectionner tout - Visualiser dans une fenêtre à part frmParametres.lblResolutionEcran.Caption = X & " x " & Y
J'ai essayé un "sleep (1000)" mais j'ai toujours la résolution d'avant.
Comment faire pour connaître la nouvelle résolution de l'écran ?
Merci
Partager