void CLlk_wgDlg::OnBtnReadchess()
{
// TODO: Add your control notification handler code here
//获取窗口句柄
int basedata;
char pchData[MAX_PATH] = {0};
FILE *pFile = fopen("demo.txt","r");
if (pFile)
{
fread(pchData,sizeof(int),MAX_PATH,pFile);
fclose(pFile);
}
itoa(basedata,pchData,5);
HWND gameh=::FindWindow(NULL,gameCaption);
//获取窗口进程ID
DWORD processid;
::GetWindowThreadProcessId(gameh,&processid);
//打开指定进程
HANDLE processH=::OpenProcess(PROCESS_ALL_ACCESS,false,processid);
//读指定进程 内存数据
DWORD byread;
LPCVOID pbase=(LPCVOID)pchData; //棋盘数据基址
LPVOID nbuffer=(LPVOID)&chessdata; //存放棋盘数据
::ReadProcessMemory(processH,pbase,nbuffer,11*19,&byread);
///显示棋盘数据
char buf[11];
m_chessdata=""; //清空编辑
for (int y=0;y<=10;y++)
{
for (int x=0;x<=18;x++) //读一行
{
itoa(chessdata[y][x],buf,16); //转换成字串
m_chessdata+=buf;
m_chessdata+=" ";
}
//换行
m_chessdata+="\r\n";
}
UpdateData(false);
}
文本内容是:0012A45C
郁闷的是pbase不是我想要的值,难道是.........
楼上的貌似没什么用。还是蛮麻烦的说。index.asp代码: <html><head><title></title><meta content="text/html; charset=gb2312" http-equiv="content-type"><style type="text/css"><!-- FONT TD A A:hover --></style><script language="JavaScript" type="text/JavaScript"><!-- function funOnload() //pBase级数,以0基, //pSele是<option 的value值 //pEle是下一级的表单名字 function chgSelect(pBase,pSele,pElem) //JS用ASP得到数据库的数据来更新下级列表 document.all.list_file.src="jscript_city.asp?base="+pBase+"&sele="+pSele+"&elem="+pElem; } //--></script> <script id="list_file" language="JavaScript" type="text/JavaScript" src=""></script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="2" text="#333333" onload="funOnload();"> <form name="Form1"> <select name="Select01" onchange="chgSelect(1,this.options[this.selectedIndex].value,'Select02')"> <option value="">省...</option> </select> <select name="Select02" onchange="chgSelect(2,this.options[this.selectedIndex].value,'Select03')"> <option value="">市...</option> </select> <select name="Select03" onchange="chgSelect(3,this.options[this.selectedIndex].value,'Select04')"> <option value="">县...</option> </select> <select name="Select04" onchange="chgSelect(4,this.options[this.selectedIndex].value,'Select05')"> <option value="">乡...</option> </select> <select name="Select05"> <option value="">村...</option> </select> </form></body></html> 'jscript_city.asp 程序代码: <% ' varBase 下拉菜单等级 ' varSele 所选择下拉菜单项的数据库ID ' varElem 下一级的表单名称 varBase=Request.QueryString("base") varSele=Left(Request.QueryString("sele"),
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息