Ok, I've a DLL that's hooked to pick up all Mouse and Keyboard events in it. What I then want to do is through all those to another window. I understand how to do simulate these events, with PostMessage and SendMessage, to the HWND, but what I'd like to do is automatically convert these into a compatible lpfnWndProc message.

Generating the UINT is easy enough, because that can be obtained in the hooks, as the WPARAM identifier. The values for LPARAM and wParam for Keyboard is also easy, but I've no idea how to get the lParam for mouse events.

From MSDN, it says that it
Indicates whether various virtual keys are down. This parameter can be one or more of the following values.

The CTRL key is down.
The left mouse button is down.
The middle mouse button is down.
The right mouse button is down.
The SHIFT key is down.
Windows 2000/XP: The first X button is down.
Windows 2000/XP: The second X button is down.
I can't see any way of getting this information from within the hooks, without keeping a static record of whether these keys were pressed already. Is there another way that I can get that information, do any of you know?