Ask the Expert

How do you send (SendKeys) a numeric pad Enter (KeyState= 00000100) key versus a standard Enter key

How do you send (SendKeys) a numeric pad Enter (KeyState= 00000100) key versus a standard Enter key (KeyState= 00000000)? Both are KeyCod 13. The Enter key and Line Feed keys work fine but the program requires a Numeric Pad Enter key to function correctly.
Instead of messing with the basically broken SendKeys function, you'll definitely want to take a look at the SendInput function. With SendInput, you'll have much more control over life and can properly force in any sort of input you want. I even wrote a relatively complete UI testing utility called Tester a few years ago (http://msdn.microsoft.com/msdnmag/issues/02/03/bugslayer/) that shows how to use it. It's a C++ application, but you'll get the idea.

This was first published in January 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: