WM_KEYDOWN, WM_KEYUP, and WM_CHAR are notifications. They are sent to your window AFTER a keystroke occurs. They should not be used to simulate one.