Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Michel Pierron
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.
Merci d'avance
Gérard
Bonjour Gerard;
Private Declare Function GetSystemMetrics& _
Lib "user32" (ByVal nIndex&)
Private Declare Function GetForegroundWindow& _
Lib "user32" ()
Private Declare Function GetWindowRect& _
Lib "user32" (ByVal hwnd&, lpRect As RECT)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub Resolution()
Dim Info As String, hwnd As Long, R As RECT
Info = "Résolution écran:" & vbTab _
& GetSystemMetrics(0) & " x " _
& GetSystemMetrics(1) & vbLf
hwnd = GetForegroundWindow
GetWindowRect hwnd, R
Info = Info & "Fenêtre active:" & vbTab _
& (R.Right - R.Left) & " x " & R.Bottom - R.Top
Info = Info & vbLf & "Fenêtre Excel:" & vbTab _
& Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3
MsgBox Info
End Sub
MP
"Gerard Ducouret" <gerard.ducouret@wanadooNOSPAM.fr> a écrit dans le message
de news:u0RZnG%23xEHA.3376@TK2MSFTNGP12.phx.gbl...
Bonjour,
je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels.
Comment faire ?
De même pour les dimensions de la fenêtre active.
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.
Merci d'avance
Gérard
Gerard Ducouret
Merci Michel, ça marche !
Mais où pourrais-je trouver de la doc sur les mots clés tels que : GetForegroundWindow GetSystemMetrics GetWindowRect ... car l'aide en ligne de VBA ne dit rien là dessus , Merci encore
Gérard
"Michel Pierron" a écrit dans le message de news:uYoz5d%
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message
de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.
Merci d'avance
Gérard
Merci Michel, ça marche !
Mais où pourrais-je trouver de la doc sur les mots clés tels que :
GetForegroundWindow
GetSystemMetrics
GetWindowRect
...
car l'aide en ligne de VBA ne dit rien là dessus ,
Merci encore
Gérard
"Michel Pierron" <michel.pierron@free.fr> a écrit dans le message de
news:uYoz5d%23xEHA.1452@TK2MSFTNGP11.phx.gbl...
Bonjour Gerard;
Private Declare Function GetSystemMetrics& _
Lib "user32" (ByVal nIndex&)
Private Declare Function GetForegroundWindow& _
Lib "user32" ()
Private Declare Function GetWindowRect& _
Lib "user32" (ByVal hwnd&, lpRect As RECT)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub Resolution()
Dim Info As String, hwnd As Long, R As RECT
Info = "Résolution écran:" & vbTab _
& GetSystemMetrics(0) & " x " _
& GetSystemMetrics(1) & vbLf
hwnd = GetForegroundWindow
GetWindowRect hwnd, R
Info = Info & "Fenêtre active:" & vbTab _
& (R.Right - R.Left) & " x " & R.Bottom - R.Top
Info = Info & vbLf & "Fenêtre Excel:" & vbTab _
& Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3
MsgBox Info
End Sub
MP
"Gerard Ducouret" <gerard.ducouret@wanadooNOSPAM.fr> a écrit dans le
message
de news:u0RZnG%23xEHA.3376@TK2MSFTNGP12.phx.gbl...
Bonjour,
je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels.
Comment faire ?
De même pour les dimensions de la fenêtre active.
Mais où pourrais-je trouver de la doc sur les mots clés tels que : GetForegroundWindow GetSystemMetrics GetWindowRect ... car l'aide en ligne de VBA ne dit rien là dessus , Merci encore
Gérard
"Michel Pierron" a écrit dans le message de news:uYoz5d%
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message
de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.
Merci d'avance
Gérard
Michel Pierron
Re Gerard; la bible se trouve là : 'URL: http://www.allapi.net/ '
télécharger le Api-guide.exe MP
"Gerard Ducouret" a écrit dans le message de news:uuEIB2$
Merci Michel, ça marche !
Mais où pourrais-je trouver de la doc sur les mots clés tels que : GetForegroundWindow GetSystemMetrics GetWindowRect ... car l'aide en ligne de VBA ne dit rien là dessus , Merci encore
Gérard
"Michel Pierron" a écrit dans le message de news:uYoz5d%
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message
de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.
Merci d'avance
Gérard
Re Gerard;
la bible se trouve là :
'URL: http://www.allapi.net/
'KPDTeam@Allapi.net
télécharger le Api-guide.exe
MP
"Gerard Ducouret" <gerard.ducouret@wanadooNOSPAM.fr> a écrit dans le message
de news:uuEIB2$xEHA.352@TK2MSFTNGP14.phx.gbl...
Merci Michel, ça marche !
Mais où pourrais-je trouver de la doc sur les mots clés tels que :
GetForegroundWindow
GetSystemMetrics
GetWindowRect
...
car l'aide en ligne de VBA ne dit rien là dessus ,
Merci encore
Gérard
"Michel Pierron" <michel.pierron@free.fr> a écrit dans le message de
news:uYoz5d%23xEHA.1452@TK2MSFTNGP11.phx.gbl...
Bonjour Gerard;
Private Declare Function GetSystemMetrics& _
Lib "user32" (ByVal nIndex&)
Private Declare Function GetForegroundWindow& _
Lib "user32" ()
Private Declare Function GetWindowRect& _
Lib "user32" (ByVal hwnd&, lpRect As RECT)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub Resolution()
Dim Info As String, hwnd As Long, R As RECT
Info = "Résolution écran:" & vbTab _
& GetSystemMetrics(0) & " x " _
& GetSystemMetrics(1) & vbLf
hwnd = GetForegroundWindow
GetWindowRect hwnd, R
Info = Info & "Fenêtre active:" & vbTab _
& (R.Right - R.Left) & " x " & R.Bottom - R.Top
Info = Info & vbLf & "Fenêtre Excel:" & vbTab _
& Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3
MsgBox Info
End Sub
MP
"Gerard Ducouret" <gerard.ducouret@wanadooNOSPAM.fr> a écrit dans le
message
de news:u0RZnG%23xEHA.3376@TK2MSFTNGP12.phx.gbl...
Bonjour,
je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels.
Comment faire ?
De même pour les dimensions de la fenêtre active.
Re Gerard; la bible se trouve là : 'URL: http://www.allapi.net/ '
télécharger le Api-guide.exe MP
"Gerard Ducouret" a écrit dans le message de news:uuEIB2$
Merci Michel, ça marche !
Mais où pourrais-je trouver de la doc sur les mots clés tels que : GetForegroundWindow GetSystemMetrics GetWindowRect ... car l'aide en ligne de VBA ne dit rien là dessus , Merci encore
Gérard
"Michel Pierron" a écrit dans le message de news:uYoz5d%
Bonjour Gerard; Private Declare Function GetSystemMetrics& _ Lib "user32" (ByVal nIndex&) Private Declare Function GetForegroundWindow& _ Lib "user32" () Private Declare Function GetWindowRect& _ Lib "user32" (ByVal hwnd&, lpRect As RECT) Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
Sub Resolution() Dim Info As String, hwnd As Long, R As RECT Info = "Résolution écran:" & vbTab _ & GetSystemMetrics(0) & " x " _ & GetSystemMetrics(1) & vbLf hwnd = GetForegroundWindow GetWindowRect hwnd, R Info = Info & "Fenêtre active:" & vbTab _ & (R.Right - R.Left) & " x " & R.Bottom - R.Top Info = Info & vbLf & "Fenêtre Excel:" & vbTab _ & Application.Width * 4 / 3 & " x " & Application.Height * 4 / 3 MsgBox Info End Sub
MP
"Gerard Ducouret" a écrit dans le message
de news:u0RZnG%
Bonjour, je voudrais pouvoir repérer en VBA la résolution de l'écran en pixels. Comment faire ? De même pour les dimensions de la fenêtre active.