   Change scancode
  I''m trying to simulate a spacebar in another window (a game) using C# and am having troubles.  Using Spy++ a spacebar in game looks like:00150140 S WM_KEYDOWN nVirtKey: VK_SPACE cRepeat:1 ScanCode:39 fExtended:0 FAltDown:0 fRepeat:0 fUp:0When I try to Sendmessage a space I get the exact same thing except Scancode is now ScanCode:00Does anyone know how I can send a space with a scancode of 39? 
  Read WM_KEYDOWN dox. Scan code is sent in lparam (bits 23:16), which you also need to fill. Isn''t there an option to not decode the message parameters in spyxx? That''d give you the correct values. ;  Ahh... Thanks,I was able change it.  There is still a problem though.  Using Spy++ I was able to verify a space was getting sent but in-game it does not show up.  My simulated space looks exactly the same as a space in-game.    ;  Is the game created by you? Otherwice the game may use e.g. DInput to achieve information from the keyboard.If that is the case have a look at VOID keybd_event(BYTE bVk, BYTE bScan, DWORD dwFlags, ULONG_PTR dwExtraInfo);which inserts keyboard data directly into the input stream on a low level.And mouse_event(....); for the mouse if needed. // Javelin-- Why do something today when you can do it tomorrow... -- ;  // edit: had the reply window open for a while, didn't see Javelin's reply.check the game's imports to see what manner of input gathering it uses (GetAsyncKeyState is another possibility).keybd_event can fake DX keys as well? hmm.   [edited by - Jan Wassenberg on February 17, 2004 8:28:31 AM];  sounds like somebody is trying to cheat the game here ;  Thanks guys, I was able to send a spacebar to the game but it didnt work in the correct way.  I was able to send a space when I am in chat mode but I couldnt get it to shoot with the spacebar.  I''m trying to use SendInput() now but I''m having trouble declaring it in c#.  Can anyone help me with the declaration please?  (sorry, I''m just starting to learn c# ) 