I am trying to use the tagRAWINPUTDEVICE
struct from WinUser.h
.
(Edited) Here is all of my code:
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#include <Windows.h>
int main()
{
RAWINPUTDEVICE rid[1];
return 0;
}
I compile the code with:
g++ test.cpp
I get this error:
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 `['
Here is the struct from 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;
I don't see any other requirements in the documentation, so I don't see why there is an error.