VB

VB如何才能获得游戏窗口句柄,并修改内存

解决方案 »

  1.   

    你看一下,我写的这个记牌器吧,里面有读内存的.'读内存的API
    Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long'写内存的API
    Private Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
      

  2.   

    首先获取窗口句柄,用下列方法:Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Longdim hpwnd as long
    hpwnd = FindWindow(vbNullString, "游戏窗口标题")然后再调用楼上所说的内存读写函数进行操作。