作者fumizuki (蒙面加菲狮)
看板Visual_Basic
标题Re: [VB6 ] Screen.width
时间Sat May 19 09:05:39 2007
※ 引述《Berger927 (rabbit)》之铭言:
: 我想问的是,用 Screen.width 是不是有什摸需要注意的地方?
: 我遇到的问题是,只要VB6的程式开着跑大游戏(会改变解析度的那种),
: 就算游戏结束後,VB6的程式还是抓到游戏改变的解析度值,而抓不到正常的视窗设定。
: 除非程式重开,不然记录档看起来都还是错误的解析度...
: 可是也没有看到 Screen.refresh 等功能... 囧rz
: 我该怎摸做才能解决这个状况?
: 知道的高手麻烦指点一下~感激不尽~~~ ^^
这好像是一直都存在的问题(汗)
刚才 try 了一下,也给自己找到了答案 囧
不过我也不确定这个做法是不是每台主机都适用@@
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, _
lpRect As RECT) As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub test()
Dim hWnd As Long, lpRect As RECT
hWnd = GetDesktopWindow
If GetWindowRect(hWnd, lpRect) <> 0 Then
MsgBox "您目前的解析度为 " & _
lpRect.Right & "x" & lpRect.Bottom & "。", vbInformation
End If
End Sub
--
▃▅▇▆▄ ▆▂▃ `
逝去感情如何能留住,半点痴情遗留殊不易,██▅▇▄▃ ▇▃▂" .
█████████▃i ▁▄▇
更多凄凄惨惨的遭遇…………██▆▃ █▅▆▃ˍ▄*
◢ ▂█▄▇▅▂▌.
我不知道,王~八~蛋~~! ▂▆███ █▄▃ 。fumizuki。Check。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.194.224.174
1F:推 Berger927:感谢~ ^^ 05/19 11:15
2F:推 MrOrz:也可以用EnumDisplaySettings //昨天才在试的API XD" 05/19 11:28