马上加入TC
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- 变量 当前句柄, handle, phwnd=array[3]
- 功能 刷新_时钟()
- //这里添加你要执行的代码
- 当前句柄=窗口.鼠标所在窗口句柄()
- 编辑框.设置文本("句柄",当前句柄)
- 编辑框.设置文本("标题",窗口.类名(当前句柄))
- 编辑框.设置文本("编辑框_游戏标题",窗口.得到标题(当前句柄))
- 机器人.画边框()
- 功能结束
- //下面这个函数由飞灵所写,dllcall的注释已经很详细了,示例中就不做修改了
- 功能 画边框()
- 变量 DesktopWindowHwnd, DesktopWindowDC, DrawMode, PenHwnd, OldPenHwnd, rect_left, rect_top, rect_right, rect_bottom
- //==================↑变量定义区↑====================
- DesktopWindowHwnd = dllcall("user32.dll", "int", "GetDesktopWindow") //取桌面窗口句柄
- DesktopWindowDC = dllcall("user32.dll", "int", "GetWindowDC", "int", DesktopWindowHwnd) //取窗口设备场景
- DrawMode = dllcall("gdi32.dll", "int", "SetROP2", "int", DesktopWindowDC, "int", 10) //设置指定设备场景的绘图模式,并返回窗口前一个绘图模式
- window.getwindowpos(当前句柄, rect_left, rect_top)
- window.getwindowsize(当前句柄, rect_right, rect_bottom)
- rect_right = rect_left + rect_right
- rect_bottom = rect_top + rect_bottom //获得整个窗口的范围矩形,窗口的边框、标题栏、滚动条及菜单等都在这个矩形内
- PenHwnd = dllcall("gdi32.dll", "int", "CreatePen", "int", 0, "int", 4, "int", #00ff00) //用指定的样式、宽度和颜色创建一个画笔,并返回一个画笔句柄
- OldPenHwnd = dllcall("gdi32.dll", "int", "SelectObject", "int", DesktopWindowDC, "int", PenHwnd) //选入设备场景,并返回以前选入设备场景的相同hObject类型的一个对象的句柄
- dllcall("gdi32.dll", "int", "Rectangle", "int", DesktopWindowDC, "int", rect_left - 1, "int", rect_top - 1, "int", rect_right + 1, "int", rect_bottom + 1)
- //help.sleep(500)
- //dllcall("gdi32.dll", "int", "Rectangle", "int", DesktopWindowDC, "int", rect_left - 1, "int", rect_top - 1, "int", rect_right + 1, "int", rect_bottom + 1) //用当前选定的画笔描绘矩形,并用当前选定的刷子进行填充
- dllcall("gdi32.dll", "int", "SelectObject", "int", DesktopWindowDC, "int", OldPenHwnd) //选入设备场景
- dllcall("gdi32.dll", "int", "SetROP2", "int", DesktopWindowDC, "int", DrawMode) //设置指定设备场景的绘图模式
- dllcall("gdi32.dll", "int", "DeleteObject", "int", PenHwnd) //删除对象
- dllcall("user32.dll", "int", "ReleaseDC", "int", DesktopWindowHwnd, "int", DesktopWindowDC) //释放由调用GetDC或GetWindowDC函数获取的指定设备场景
- 功能结束
- //消息路由功能
- 功能 机器人_消息路由(句柄,消息,w参数,l参数,时间,x坐标,y坐标)
- 如果(消息 == 512)
- xx=0
- 如果(句柄 == handle)
- dllcall("user32.dll", "int", "SetClassLongA", "int", handle, "int", -12, "int", phwnd[0]) //设置鼠标指针为 光标.ico
- xx=1
- 如果结束
- 如果(xx==0)
- dllcall("user32.dll", "int", "SetClassLongA", "int", handle, "int", -12, "int", phwnd[1]) //设置鼠标指针为 光标.ico
- 如果结束
- 如果结束
-
- //==================↑设置鼠标指针↑====================
-
- 如果(句柄 == handle && 消息 == 513)
- timer.register("刷新", 500) //注册时钟
- picture.setpicture("图片框_鼠标", "rc:bk0.bmp") //设置"图片框_鼠标拖拽框"图片
- dllcall("user32.dll", "int", "SetCapture", "int", handle) //捕获鼠标
- 如果结束
- //==================↑左键按下事件↑====================
-
- 如果(句柄 == handle && 消息 == 514)
- timer.kill("刷新")
- dllcall("user32.dll", "int", "ReleaseCapture") //释放鼠标
- dllcall("user32.dll", "int", "SetClassLongA", "int", handle, "int", -12, "int", phwnd[1])
- picture.setpicture("图片框_鼠标", "rc:bk1.bmp") //设置"图片框_鼠标拖拽框"图片
-
- 如果结束
-
- 返回 假
- 功能结束
- 功能 初始化()
- //这里添加你要执行的代码
- rcpath = help.getrcpath("rc:")
- handle = control.gethandle("图片框_鼠标")
-
- phwnd[0] = dllcall("user32.dll", "int", "LoadCursorFromFileA", "char *", rcpath & "eye.cur") //取鼠标指针 光标.ico 句柄
- phwnd[1] = dllcall("user32.dll", "int", "GetClassLongA", "int", handle, "int", -12) //取默认鼠标指针句柄
- phwnd[2] = dllcall("user32.dll", "int", "LoadCursorFromFileA", "char *", rcpath & "坐标.cur") //取鼠标指针 光标.ico 句柄
-
- 功能结束
复制代码 我把那个案例的英文关键字都改成中文,然后在我自己建的脚本中使用的时候无法使用 |