Hello everyone,

Is there an equivalent to SendKeys.Send in C++? I have looked into keybd_event and SendInput, but to my knowledge you can only send one key at a time with those functions.

Thanks for any help.

Edit: I'm not using the .Net Framework so I can't use any of that stuff.

Recommended Answers

All 4 Replies

Member Avatar for iamthwee

>you can only send one key at a time with those functions

Can't you put it in a loop?

>>Is there an equivalent to SendKeys.Send in C++?

No. C++ language knows nothing (other than what it inherited from C language in stdio.h) about the keyboard because its os specific. You have to use os-specific api function calls to send them one character at a time like jamthwee suggested.

If I had the source of the application being controlled, I would use ole/COM automation instead to avoid the possible hit or miss performance of SendKeys but what would you learn if you could not try? So, I don't know either
BUT I refer you to a codeproject article called 'Sendkeys in C++' because someone thinks it is possible and the article has a high rating.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.