我正在尝试使用tagRAWINPUTDEVICE
中的WinUser.h
结构。
(已编辑)这是我所有的代码:
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#include <Windows.h>
int main()
{
RAWINPUTDEVICE rid[1];
return 0;
}
我用以下代码编译代码:
g++ test.cpp
我收到此错误:
test.cpp: In function `int main()':
test.cpp:8: `RAWINPUTDEVICE' undeclared (first use this function)
test.cpp:8: (Each undeclared identifier is reported only once
test.cpp:8: for each function it appears in.)
test.cpp:8: parse error before `['
这是WinUser.h
中的结构:
typedef struct tagRAWINPUTDEVICE {
USHORT usUsagePage; // Toplevel collection UsagePage
USHORT usUsage; // Toplevel collection Usage
DWORD dwFlags;
HWND hwndTarget; // Target hwnd. NULL = follows keyboard focus
} RAWINPUTDEVICE, *PRAWINPUTDEVICE, *LPRAWINPUTDEVICE;
documentation中没有其他要求,所以我看不到为什么有错误。