PCのモニターサイズを取得

Declare Function GetSystemMetrics32 Lib "User32" _
    Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long

Sub DisplayMonitorInfo()
    Dim w As Long, h As Long
    w = GetSystemMetrics32(0)     ' Width in points
    h = GetSystemMetrics32(1)     ' Height in points
    MsgBox Format(w, "#,##0") & " x " & Format(h, "#,##0"), _
        vbInformation, "Monitor Size (width x height)    "
End Sub
 
 
 
 
 
 
 
 
 

最終更新のRSS
Last-modified: 2014-03-11 (火) 01:58:42 (1715d)