利用Description创建对象,分别获取桌面的高度和宽度
Public Function get_res()
Set progman = Description.Create
progman("Object Class").Value = "Progman"
progman("Text").Value = "Program Manager"
get_res = Window(progman).GetROProperty ("width") & "*" & Window(progman). GetROProperty ("height")
End Function
msgbox get_res()
本文介绍了一种使用VBA编程语言来获取当前桌面分辨率的方法。通过创建对象并利用Description属性,可以有效地读取桌面的宽度和高度。此方法适用于那些需要在VBA环境中动态获取屏幕尺寸的应用场景。

6176

被折叠的 条评论
为什么被折叠?



