hWnd=FindWindow("Callus95",NULL); //得到Callus95的窗口句柄
if(hWnd==NULL)
{
SetForegroundWindow(hDlg);
MessageBox(GetActiveWindow(),"Callus 95没有运行","错误",MB_OK|MB_ICONERROR);
return(TRUE);
}
GetWindowThreadProcessId(hWnd,&GameID); //得到线程ID
hGame=OpenProcess(PROCESS_ALL_ACCESS,TRUE,GameID); //打开进程
if(wParam==1111) //按了Player1的热键
{
if(IsDlgButtonChecked(hDlg,IDC_CHECK1)==BST_CHECKED) //Player1的减血复选框打了勾
Power=(char)0; //血为0
else
Power=(char)144; //血满
WriteProcessMemory(hGame,(void *)(0x700c78),&Power,1,NULL);
WriteProcessMemory(hGame,(void *)(0x700c7a),&Power,1,NULL);
WriteProcessMemory(hGame,(void *)(0x700e0a),&Power,1,NULL);
}
if(hWnd==NULL)
{
SetForegroundWindow(hDlg);
MessageBox(GetActiveWindow(),"Callus 95没有运行","错误",MB_OK|MB_ICONERROR);
return(TRUE);
}
GetWindowThreadProcessId(hWnd,&GameID); //得到线程ID
hGame=OpenProcess(PROCESS_ALL_ACCESS,TRUE,GameID); //打开进程
if(wParam==1111) //按了Player1的热键
{
if(IsDlgButtonChecked(hDlg,IDC_CHECK1)==BST_CHECKED) //Player1的减血复选框打了勾
Power=(char)0; //血为0
else
Power=(char)144; //血满
WriteProcessMemory(hGame,(void *)(0x700c78),&Power,1,NULL);
WriteProcessMemory(hGame,(void *)(0x700c7a),&Power,1,NULL);
WriteProcessMemory(hGame,(void *)(0x700e0a),&Power,1,NULL);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货