能给一个例子子吗
解决方案 »
- socket send数据大小问题
- 求下载网页的软件,要带有url筛选的
- 要用MFC做一个局域网C语言考试系统,具体该怎么做?
- 紧急求助:double和float型的最小、大值的字符串表示是?
- 非常弱智的问题,散分100,各位大侠请帮忙,急!!!
- USHORT C = '陈'; USHORT D = L'陈'; C 和 D有什么不同,怎么样由D到C转换?
- 这就是程序员的下场吗? 今天公司一位30多的程序员惨遭解雇
- _stdcall是什么意思?还有COM接口是怎么一回事?
- 高分请教一个activeX的问题
- 请教!!!如果编程替换掉WINDOWS的外壳!!!不要修改注册表!!!
- 简单的问题 请教VC++高手:在MFC中,如何把剪贴板中的位图按原比例打印出来? 分不够再加!
- 为什么剪贴板中的位图打印不出来?
是这样的,由于不同的进程间没有办法传递指针,所以没有办法得到其他树的内容
建议使用钩子,
同时也有其他的方法。
你可以参考帖子:http://expert.csdn.net/Expert/topic/1803/1803463.xml?temp=.8687097/////////////////////////////////////////////////////////////
a) Obtain process id of B by GetWindowThreadProcessId(hTV,&pid)b) Get the process handle of B by OpenProcess(PROCESS_VM_WRITE| PROCESS_VM_OPERATION | PROCESS_VM_READ)c) Allocate the memory in the address space of B by VirtualAllocEx. Allocated block must be large enough
to hold TVITEM structure and the buffer for the item text. Like this:struct S {
TVITEM it;
char buf[120];
} s;S* ps=VirtualAllocEx(... sizeof(s)...)d) Fill allocated memory by WriteProcessMemory:s.it.iItem=...;
...
s.pszText=LPSTR(
LPBYTE(ps)+(LPBYTE(s.buf)-LPBYTE(&s)) );
s.cchTextMax=sizeof(s.buf);Now copy s struct to ps by WriteProcessMemory.e) Call TreeView_GetItem(hTV,ps);f) Read contents of ps->buf by ReadProcessMemory()g) Use VirtualFreeEx to free memory and CloseHandle to close process handle.