checkyvc6(checkyvc6)编译通不过 E:\chuanqi\keyHookNew\DlgHook.cpp(68) : error C2039: 'GetWindowProcessId' : is not a member of '`global namespace'' E:\chuanqi\keyHookNew\DlgHook.cpp(68) : error C2065: 'GetWindowProcessId' : undeclared identifier 查msdn定义是 CWindow::GetWindowProcessID 另外我这是个dll没有cwin之类的!
AfxGetApp()->m_hThread
和
OpenProcess获得的有没有区别啊?
感觉好象不一样
OpenProcess还有那么多的参数!
HANDLE hRead = ::OpenProcess(PROCESS_ALL_ACCESS | PROCESS_TERMINATE | PROCESS_VM_OPERATION | PROCESS_VM_READ| PROCESS_VM_WRITE, FALSE, dwProcessId);
if(NULL == hRead)
{
AfxMessageBox("no such process");
return;
}
else
{
WORD buf;
BOOL bSuccess = ReadProcessMemory(hRead, (LPCVOID)0x00800E0F, (LPVOID)&buf, 4, NULL);
if(FALSE == bSuccess)
{
return;
}
else
{
ltoa(buf, cpTest, 4);
AfxMessageBox(cpTest);
}
}
CloseHandle(hRead);
我是像上面那样写的,不行啊,每次执行会执行这句
AfxMessageBox("no such process");
GetCurrentThreadId
GetCurrentThread
GetCurrentThreadId
GetCurrentThread
怎么就是不行啊?
还是执行这句
AfxMessageBox("no such process");
如果我用
HWND hwndTest = ::FindWindow("WH GEngine","Legend");
::GetWindowThreadProcessId(hwndTest, &dwProcessId);
就可以啊!
DWORD dwProcessId = AfxGetApp()->m_nThreadID
把它改成:
DWORD dwProcessId=::GetWindowProcessId(AfxGetMainWnd()->m_hWnd);
E:\chuanqi\keyHookNew\DlgHook.cpp(68) : error C2039: 'GetWindowProcessId' : is not a member of '`global namespace''
E:\chuanqi\keyHookNew\DlgHook.cpp(68) : error C2065: 'GetWindowProcessId' : undeclared identifier
查msdn定义是
CWindow::GetWindowProcessID
另外我这是个dll没有cwin之类的!