This function simulates a keypress. It doesn't detect keypresses. For detecting keypresses, you may want: http://msdn.microsoft.com/en-us/library/ms646299(VS.85).aspx
You'll need a bool array[256] to store the data returned from this function.
This is just for when you work your way up to that level.
The function that simulates a keypress takes the key "name", a hardware scan code for the key that you will need to look into, any information needed about the keypress, such as if the key has a prefix byte that has the value of 224 (experiment to see if you need this) and if the key is being released, and something that for you should be zero.
You will need something to detect the keypresses, though.