HWND h = ::FindWindow(NULL, TEXT("扫雷"));
if (h == 0)
{
::MessageBox(NULL, TEXT("未找到扫雷"), NULL, MB_OK);
return;
}
DWORD pid;
::GetWindowThreadProcessId(h,&pid);
HANDLE hp = ::OpenProcess(PROCESS_ALL_ACCESS,FALSE,pid);
if (hp==NULL)
{
::MessageBox(NULL, TEXT("hp 为 空"), TEXT(""), MB_OK);
}
LPCVOID addr = (LPCVOID)0x01005194;
//线程句柄 要读取的地址 读出来的数据存放变量 读取字节数 线程id
ReadProcessMemory(hp,addr,&m_edit_Base,4,&pid);
网友评论