H
Heesob Park
As you know, the INPUT structure defined like this:2009/12/30 Marvin G=C3=BClker said:Works great! But I have a question about the 0.chr line: Why do you need
to append 8 extra bytes to achieve a size of 28 bytes? I guess, it has
something to do with C's array treatment?
typedef struct tagINPUT {
DWORD type;
union {MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
};
}INPUT, *PINPUT;
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT, *PMOUSEINPUT;
typedef struct tagKEYBDINPUT {
WORD wVk;
WORD wScan;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KEYBDINPUT, *PKEYBDINPUT;
typedef struct tagHARDWAREINPUT {
DWORD uMsg;
WORD wParamL;
WORD wParamH;
} HARDWAREINPUT, *PHARDWAREINPUT;
The sizeof(MOUSEINPUT) is 24, sizeof(KEYBDINPUT) is 16, and
sizeof(HARDWAREINPUT) is 8.
Therefore, sizeof(INPUT) =3D sizeof(DWORD) + maxsizeof(union) =3D 4 + 24 =
=3D 28.
Regards,
Park Heesob