求一段VB声明的讲解,最好具体到每一句都是干什么的,谢谢!
发布网友
发布时间:2024-10-20 13:41
我来回答
共3个回答
热心网友
时间:2024-11-14 15:39
Private Type POINTAPI
x As Long
y As Long
End Type
'自定义数据类型,用来存屏幕坐标
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
'将一幅位图从一个设备场景复制到另一个。源和目标DC相互间必须兼容
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
'该函数检取光标的位置,以屏幕坐标表示
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
'获取指定窗口的设备场景
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
'在指定的设备场景中取得一个像素的RGB值
Private Declare Function ScreenToClient Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
'判断屏幕上一个指定点的客户区坐标
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
'返回包含了指定点的窗口的句柄。忽略屏蔽、隐藏以及透明窗口
觉得不够具体 可自行下载 《Windows API 函数 for Visual Basic》来查阅
热心网友
时间:2024-11-14 15:40
补充:
Option Explicit
所有变量必须定义后才可以使用
热心网友
时间:2024-11-14 15:40
POINTAPI是类型,比如储存鼠标位置。
下面的全是API函数,你查一查百科吧