|
发表于 2009-9-18 23:43:47
|
显示全部楼层
获取找到了,修改没发现
Func _GetDPI ()
Local $a1[3]
Local $iDPI, $iDPIRat, $Logpixelsy = 90, $hWnd = 0
Local $hDC = DllCall("user32.dll", "long", "GetDC", "long", $hWnd)
Local $aRet = DllCall("gdi32.dll", "long", "GetDeviceCaps", "long", $hDC[0], "long", $Logpixelsy)
Local $hDC = DllCall("user32.dll", "long", "ReleaseDC", "long", $hWnd, "long", $hDC)
$iDPI = $aRet[0]
Select
Case $iDPI = 0
$iDPI = 96
$iDPIRat = 94
Case $iDPI < 84
$iDPIRat = $iDPI / 105
Case $iDPI < 121
$iDPIRat = $iDPI / 96
Case $iDPI < 145
$iDPIRat = $iDPI / 95
Case Else
$iDPIRat = $iDPI / 94
EndSelect
$a1[0] = 2
$a1[1] = $iDPI
$a1[2] = $iDPIRat
;; Return the array
Return $a1
EndFunc
$dpi = _getDPI()
msgbox(0,"dpi",$dpi[1]) |
|