展开全部
#Include <WinAPI.au3>
Const $HORZRES = 8
Const $VERTRES = 10
Const $SM_CXSCREEN = 0
Const $SM_CYSCREEN = 1
GetScrXY1()
GetScrXY2()
GetScrXY3()
Func GetScrXY1()
MsgBox(0, "AutoIt系统信息宏", "方法一 屏幕像素:" & @DesktopWidth & "x" & @DesktopHeight)
EndFunc
Func GetScrXY2()
Local $hWnd = _WinAPI_GetDesktopWindow()
Local $hDc = _WinAPI_GetDC($hWnd)
MsgBox(0, "gdi32.dll GetDeviceCap", "方法二 屏幕像素:" & _WinAPI_GetDeviceCaps($hDc, $HORZRES) & "x" & _WinAPI_GetDeviceCaps($hDc, $VERTRES))
EndFunc
Func GetScrXY3()
MsgBox(0, "user32.dll GetSystemMetrics", "方法三 屏幕像素:" & _WinAPI_GetSystemMetrics($SM_CXSCREEN) & "x" & _WinAPI_GetSystemMetrics($SM_CYSCREEN))
EndFunc
Const $HORZRES = 8
Const $VERTRES = 10
Const $SM_CXSCREEN = 0
Const $SM_CYSCREEN = 1
GetScrXY1()
GetScrXY2()
GetScrXY3()
Func GetScrXY1()
MsgBox(0, "AutoIt系统信息宏", "方法一 屏幕像素:" & @DesktopWidth & "x" & @DesktopHeight)
EndFunc
Func GetScrXY2()
Local $hWnd = _WinAPI_GetDesktopWindow()
Local $hDc = _WinAPI_GetDC($hWnd)
MsgBox(0, "gdi32.dll GetDeviceCap", "方法二 屏幕像素:" & _WinAPI_GetDeviceCaps($hDc, $HORZRES) & "x" & _WinAPI_GetDeviceCaps($hDc, $VERTRES))
EndFunc
Func GetScrXY3()
MsgBox(0, "user32.dll GetSystemMetrics", "方法三 屏幕像素:" & _WinAPI_GetSystemMetrics($SM_CXSCREEN) & "x" & _WinAPI_GetSystemMetrics($SM_CYSCREEN))
EndFunc
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询