By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,509 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,509 IT Pros & Developers. It's quick & easy.

Using the SendInput API call from C#

P: n/a
need my C# app to send a character to a different application. I believe I
need to use the SendInput API call and to pass a KEYBDINPUT struct into
that but I am lost past that point. Here is the code I have

struct KEYBDINPUT
{
public short wVk; //the actual key
public short wScan; //not needed
public int dwFlags; //not needed
public int time; //not needed
public IntPtr dwExtraInfo; //not needed
}
[System.Runtime.InteropServices.DllImportAttribute( "user32.dll")]
private static extern UINT SendInput(
UINT nInputs, // count of input events
LPINPUT pInputs, // array of input events
int cbSize // size of structure
);

I was hoping someone might help fill in the gaps in my understanding. How
would i send the char 'c' for instance.

Thanks in advance,
~Logan


Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.