[转载][原创]求助
Private Sub Command1_Click()Dim GameHwnd As Long
Dim Pid As Long
GameHwnd = FindWindow(vbNullString, "DemonStar v4.0 Shareware")
If GameHwnd = 0 Then
MsgBox "Error:Can Not Find Game!"
Exit Sub
End If
GetWindowThreadProcessId GameHwnd, Pid
Dim hProcess As Long
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, Pid)
Dim GameHPValue As Long
GameHPValue = 10
If hProcess = 0 Then
MsgBox "error"
End If
WriteProcessMemory hProcess, &H5CD7C0, GameHPValue, 4, 0&
CloseHandle hProcess
End Sub
这是修改雷电游戏的代码,不知道哪出错了,hProcess的返回值总是0,急啊!!对了系统是在xp下的,不过在98下返回值虽然不为0但修改不了.