Declare Function GetSystemMetrics32 Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Sub DisplayMonitorInfo()
Dim X As Long, Y As Long
X = GetSystemMetrics32(0) ' 宽度(像素)
Y = GetSystemMetrics32(1) ' 高度(像素)
MsgBox "屏幕分辨率为:" & X & " × " & Y & " 像素"
End Sub