Код: Выделить всё
Private Sub Command1_Click()
Dim hwnd As Long
Dim pid As Long
Dim pHandle As Long
hwnd = FindWindow(vbNullString, "White Gold")
If (hwnd = 0) Then
MsgBox "Окно не найдено!", vbOKOnly + vbExclamation, "Внимание!"
Exit Sub
End If
GetWindowThreadProcessId hwnd, pid
pHandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
If (pHandle = 0) Then
MsgBox "Couldn't get a process handle due to syserror: " & CStr(Err.LastDllError)
Exit Sub
End If
WriteProcessMemory pHandle, &H2D94E2DC, "Beans", 5, 0&
CloseHandle hProcess
End Sub