转换屏幕指定点坐标到客户端屏幕坐标
#Include <WinAPI.au3>
_WinAPI_ScreenToClient($hWnd, ByRef $tPoint)
$hWnd | 转换使用的窗口标识 |
$tPoint | 包含要转换的屏幕坐标的 $tagPOINT 结构 |
成功: | 返回 True |
失败: | 返回 False |
在MSDN中搜索
#include <WinAPI.au3>
_Main()
Func _Main()
Local $hwnd = GUICreate("Example", 200, 200)
Local $tpoint = DllStructCreate("int X;int Y")
DllStructSetData($tpoint, "X", 641)
DllStructSetData($tpoint, "Y", 459)
GUISetState(@SW_SHOW)
Sleep(1000)
_WinAPI_ScreenToClient($hwnd, $tpoint)
MsgBox(0, "_WINAPI_ClientToScreen Example", "Screen Cordinates of 641,459 is x,y position of client: " & @LF & _
"X: " & DllStructGetData($tpoint, "X") & @LF & _
"Y: " & DllStructGetData($tpoint, "Y") & @LF)
EndFunc ;==>_Main