Ruby 在 Windows 下获取当前鼠标光标的位置

2015-01-04 0 309
Ruby 在 Windows 下获取当前鼠标光标的位置
result = "0"*8   # Eight bytes (enough for two longs)
getCursorXY = Win32API.new("user32","GetCursorPos",["P"],"V")
getCursorXY.call(result)
x, y = result.unpack("LL")  # Two longs

遇见资源网 ruby Ruby 在 Windows 下获取当前鼠标光标的位置 http://www.ox520.com/16240.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务