const PCHAR gameCaption="QQ游戏 - 连连看角色版";
byte chessdata[11][19];//a[y][x]
void CLlkwgDlg::OnButton1() 
{
// TODO: Add your control notification handler code here
//获取窗口句柄
HWND gameh=::FindWindow(NULL,gameCaption);
//获取窗口进程ID
DWORD processid;
::GetWindowThreadProcessId(gameh,&processid);
//打开指定进程
HANDLE processH=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,processid);
//读指定进程 内存数据
DWORD byread;
LPCVOID pbase;
pbase=(LPCVOID)0x0012A1F8;//棋盘数据基址
LPVOID nbuffer=(LPVOID)byread;//存放棋盘数据
::ReadProcessMemory(processH,pbase,nbuffer,11*19,&byread);
char buf;
m_chessdata="";
for(int y=0;y<11;y++)
{
for(int x=0;x<19;x++)
{
itoa(chessdata[y][x],&buf,16);//转换成字串
m_chessdata+=buf;
m_chessdata+=" ";
}
m_chessdata+="\r\n";
}
UpdateData(FALSE);
}
显示出来的全是0 而不是棋盘数据 搞了2天还没有明白游戏