赞 | 7 |
VIP | 20 |
好人卡 | 0 |
积分 | 16 |
经验 | 11472 |
最后登录 | 2024-7-10 |
在线时间 | 526 小时 |
Lv3.寻梦者 宛若
- 梦石
- 0
- 星屑
- 1573
- 在线时间
- 526 小时
- 注册时间
- 2007-8-19
- 帖子
- 1493
![极短24参与](static/image/common/p1/jd24/Extiny24_2.png) ![开拓者](static/image/common/p1/thx.png)
|
6R神码时候还带度娘自动吞贴功能了
重新补充:- #==============================================================================
- # ■ Kernel
- #------------------------------------------------------------------------------
- # 该模块中定义了可供所有类使用的方法。Object 类中包含了该模块。
- #==============================================================================
- module Kernel
- #--------------------------------------------------------------------------
- # ● 需要的 Windows API 函数
- #--------------------------------------------------------------------------
- GetWindowThreadProcessId = Win32API.new("user32", "GetWindowThreadProcessId", "LP", "L")
- GetWindow = Win32API.new("user32", "GetWindow", "LL", "L")
- GetClassName = Win32API.new("user32", "GetClassName", "LPL", "L")
- GetWindowText = Win32API.new("user32", "GetWindowText", "LPL", "L")
- GetCurrentThreadId = Win32API.new("kernel32", "GetCurrentThreadId", "V", "L")
- GetForegroundWindow = Win32API.new("user32", "GetForegroundWindow", "V", "L")
- #--------------------------------------------------------------------------
- # ● 获取窗口句柄
- #--------------------------------------------------------------------------
- def get_window_handle
- # 获取调用线程(RM 的主线程)的进程标识
- threadID = GetCurrentThreadId.call
- # 获取 Z 次序中最靠前的窗口
- hWnd = GetWindow.call(GetForegroundWindow.call, 0)
- # 枚举所有窗口
- while hWnd != 0
- # 如果创建该窗口的线程标识匹配本线程标识
- if threadID == GetWindowThreadProcessId.call(hWnd, 0)
- # 分配一个 11 个字节的缓冲区
- className = " " * 11
- # 获取该窗口的类名
- GetClassName.call(hWnd, className, 12)
- # 如果匹配 RGSS Player 则跳出循环
- break if className == "RGSS Player"
- end
- # 获取下一个窗口
- hWnd = GetWindow.call(hWnd, 2)
- end
- return hWnd
- end
- end
- $peekmessage = Win32API.new("user32","PeekMessageA","pllll","l")
- module Input
- class << self
- alias old_update update
- def update
- old_update
- point = [0,0].pack("ll")
- a = [0,0,0,0,0,point].pack("l5a*")
- if $peekmessage.call(a,get_window_handle,522,522,1) != 0
- arr = a.unpack("l5a*")
- @wheel = arr[2]
- else
- @wheel = 0
- end
- end
- def wheel
- if @wheel.nil?
- return 0
- else
- return @wheel
- end
- end
- end
- end
复制代码 就是这样的代码……错误状况是只有鼠标在移动的时候才可以处理滚轮滚动的消息……求解此诡异问题…… |
|