Código:
Public Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, ByVal lpNumberOfBytesWritten As Long) As Long
Me devuelve algo raro :S
Te dejo todo por las dudas:
X=LONG
Código:
Call Read(&HF227D8, "CaptionVentana", X)
Funcion Read:
Código:
Public Function Read(address As Long, gamewindowtext As String, valbuffer As Long)
Dim hWnd As Long
Dim pid As Long
Dim phandle As Long
hWnd = FindWindow(vbNullString, gamewindowtext)
If (hWnd = 0) Then
Exit Function
End If
GetWindowThreadProcessId hWnd, pid
phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If (phandle = 0) Then
Exit Function
End If
Dim bArrayTemp(10) As Byte
Call ReadProcessMem(phandle, address, VarPtr(bArrayTemp(0)), 10, 0&)
X = VarPtr(bArrayTemp(0))
End Function
Estoy poniendo cualquiera quizas pero cada ves que ejecuto me devuelve 2 valores diferentes en X.