Windows sends a WM_KEYDOWN message to your window when that happens.
Or, if you are not using windows messages, you can still use GetAsyncKeyState, just keep track of it's previous state:
1 2 3 4 5 6 7 8 9 10 11
bool keypressed;
bool keydown;
// do this every 'frame' or every time you update:
bool tmp = GetAsyncKeyState( whatever );
if( !keydown && tmp ) // key wasn't down previously, but now is down
keypressed = true; // so it was just pressed
else // otherwise, it was not just pressed
keypressed = false;
keydown = tmp;