Hi danzar, the way I read the documentation on KEYBDINPUT structure, you must specify a valid dwExtraInfo "Specifies an additional value associated with the keystroke. Use the GetMessageExtraInfo function to obtain this information" so I think your zero value is not good enough. BTW: I noticed the mouse struct is smaller than the keyboard struct, but the original INPUT has a union, so its size must accomodate the largest of them (once you try my INPUTM, it would fail if you don't take care of that!). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google