注册会员 登录
Project1 返回首页

汪汪的个人空间 https://rpg.blue/?171386 [收藏] [复制] [分享] [RSS]

日志

学习win32

已有 52 次阅读2015-5-25 10:08

  Win32API.new("user32", "GetMessage", "plll", "L")
参数1 字符串 呼叫dll名称
参数2 字符串 dll中dllexport的名称
参数3 字符串数组 表示每个参数的类型 L代表Long P代表Point I代表Int V代表Void (在实际使用的时候HResult和各种Handle都是Long,字符串是P)
参数4 字符串 表示返回值类型 同上

GetMessage =  Win32API.new("user32", "GetMessage", "plll", "L")
  #找出某个窗口的创建者
  GetWindowThreadProcessId = Win32API.new("user32","GetWindowThreadProcessId",
  "LP", "L")
  #该函数返回与指定窗口有特定关系(如Z序或所有者)的窗口句柄
  GetWindow = Win32API.new("user32", "GetWindow", "LL", "L")
  #该函数获得指定窗口所属的类的类名
  GetClassName = Win32API.new("user32", "GetClassName", "LPL", "L")
  #获取当前线程一个唯一的线程标识符
  GetCurrentThreadId = Win32API.new("kernel32", "GetCurrentThreadId", "V", "L")
  #获取一个前台窗口的句柄(窗口与用户当前的工作)
  GetForegroundWindow = Win32API.new("user32", "GetForegroundWindow", "V", "L")
  #设置窗口 
  SetWindowPos = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')
  
  #获取系统信息
  GetSystemMetrics = Win32API.new("user32","GetSystemMetrics","l","l")
  #返回指定窗口的边框矩形的尺寸
  GetWindowRect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l')
  
  DragDetect =  Win32API.new('user32.dll', 'DragDetect', 'lp', 'l')
  #显示或隐藏光标
  ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
  #检取当前光标位置
  GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
  #把光标移到屏幕的指定位置
  SetCursorPos = Win32API.new("user32", "SetCursorPos", 'ii', 'l')
  
  #可以把你在屏幕上鼠标的位置转换为你打开的程序的客户区的坐标(位置)
  ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
  #将你打开的APP中客户区的坐标点信息转换为整个屏幕的坐标
  ClientToScreen = Win32API.new("user32", "ClientToScreen", 'ip', 'i')

  #获得与调用线程的消息队列相关的活动窗口的窗口句柄
  GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
  Window_HWND = GetActiveWindow.call
  #虚拟鼠标
  MouseEvent = Win32API.new("user32", "mouse_event", "iiiii", 'l')
   #SystemParametersInfo  = Win32API.new("user32" ,"SystemParametersInfo","iipi","l")
  #按键
  GetKeyState = Win32API.new("user32","GetAsyncKeyState",['I'],'I') 
  
  KeybdEvent = Win32API.new("user32", "keybd_event", "iiii", 'l')
  

鸡蛋

鲜花

评论 (0 个评论)

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-10 04:55

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部