返回列表 上一主題 發帖

[分享] get螢幕解析度

[分享] get螢幕解析度

Option Explicit

Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1
Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Sub 目前螢幕解析度()
    Dim ScreenHeight, ScreenWidth
    ScreenHeight = GetSystemMetrics(SM_CYSCREEN)  '取得高度的像素
    ScreenWidth = GetSystemMetrics(SM_CXSCREEN)   '取得寬度的像素
    MsgBox "目前螢幕解析度:" & ScreenWidth & "*" & ScreenHeight
End Sub

        靜思自在 : 話多不如話少,話少不如話好。
返回列表 上一主題