MsgBox Screen.Width / 15 & "X" & Screen.Height / 15

解决方案 »

  1.   

    screen.width/ screen.twipsperpixelx
    screen.height/ screen.tiwpsperpixely
      

  2.   

    if use api u can call GetSystemMatrix
      

  3.   

    不需要api函数,只要用SYSINFO控件就可以了,SysInfo1.WorkAreaHeight得到桌面的高度,SysInfo1.WorkAreaWidth得到桌面的宽度。
      

  4.   

    看看这个:
        If GetSystemMetrics(SM_CXSCREEN) <> "800" Or GetSystemMetrics(SM_CYSCREEN) <> "600" Then
            FrmDel.Label1 = "   本软件须运行在800*600分辩率下,是否改更分辩率?"
            FrmDel.Caption = "更改分辩率"
            FrmDel.Show 1
            If DelOK = True Then
                X = SetDisplayMode(800, 600, 16)
                If X <> 0 Then MessBox ("    无法更改分辩率,请您手动修改!"): End
            End If
        End If
    用:
    '读取分辩率
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Private Const SM_CXSCREEN = 0
    Private Const SM_CYSCREEN = 1
    '设置分辩率
    Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (lpString1 As Any, lpString2 As Any) As Long
    Private Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" (ByVal lpDevMode As Long, ByVal dwFlags As Long) As Long
    Const CCHDEVICENAME = 32
    Const CCHFORMNAME = 32
    多给分当然是好了:)