标题:如何获取显卡 2 的分辨率?
只看楼主
zdwlzcsm
Rank: 2
等 级:论坛游民
帖 子:11
专家分:25
注 册:2014-11-17
结帖率:100%
 问题点数:0 回复次数:1 
如何获取显卡 2 的分辨率?
如何获取显卡2的分辨率?
搜索更多相关主题的帖子: 分辨率 如何 
2014-11-20 18:49
xzlxzlxzl
Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
来 自:湖北
等 级:贵宾
威 望:125
帖 子:1091
专家分:5825
注 册:2014-5-3
得分:0 
使用EnumDisplayMonitors函数枚举,把下述代码放到模块中,在窗口里调用FillMonitorInfo即可看到效果(百度http://blog.到的,经测试可以运行)。
Option Explicit

Private Declare Function EnumDisplayMonitors Lib "user32.dll" (ByVal hdc As Long, ByVal lprcClip As Long, ByVal lpfnEnum As Long, ByVal dwData As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Private Type RECTANGLE
    LeftTopX    As Long
    LeftTopY    As Long
    RightDownX  As Long
    RightDownY  As Long
End Type

Public Function FillMonitorInfo() As Integer
    Call EnumDisplayMonitors(ByVal 0&, ByVal 0&, AddressOf EnumMonitor, ByVal 0&)
End Function
Public Function EnumMonitor(ByVal hMoinitor As Long, ByVal hdcMonitor As Long, lprcMonitor As Long, ByVal dwData As Long) As Long
    Dim rcS As RECTANGLE
    CopyMemory rcS, lprcMonitor, Len(rcS)
    Debug.Print rcS.LeftTopX; rcS.LeftTopY; rcS.RightDownX - rcS.LeftTopX; rcS.RightDownY - rcS.LeftTopY; rcS.RightDownX; rcS.RightDownY
    EnumMonitor = 1
End Function
2014-11-21 07:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-438925-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.258221 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved