帮我看看三个基础的函数FindWindow,GetWindowThreadProcessId,SetWindowsHookEx
这是一个dll文件里的
#include <windows.h>
char GameName[]="war3.exe";
HHOOK m_hKbid=NULL;
LRESULT CALLBACK KeyboardProc(
int code, // hook code
WPARAM wParam, // virtual-key code
LPARAM lParam // keystroke-message information
)
{
return 1;
}
HWND m_hWnd=FindWindow(0,"HTest.txt");
DWORD m_proId=NULL; //试过0
m_proId=GetWindowThreadProcessId(m_hWnd,NULL); //。。。。出错地点。。。。
/*HWND m_hWnd=FindWindow(0,"HTest.txt"); //注释起来的这样也试过。
DWORD m_proId=NULL;
GetWindowThreadProcessId(m_hWnd,&m_proId);*/ // 。。。。出错地点。。。。
void SetHook()
{
m_hKbid=SetWindowsHookEx(WH_KEYBOARD,KeyboardProc,GetModuleHandle("WarHook"),m_proId);
}
现在的错误:
m_proId' : missing storage-class or type specifiers
m_proId' : redefinition; different basic types
使用注释了的那三句时的错误:
GetWindowThreadProcessId' : missing storage-class or type specifiers
GetWindowThreadProcessId' : redefinition; different type modifiers