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

SendKeys problem when using Non-English Windows keyboard layouts

P: n/a
Hi,

I'm experiencing a problem when using the VB SendKeys method. I'm
sending characters to a textbox in another application. It works fine
when the Windows Input Languages on both apps are set to English, but
if they are set to say German, I'm getting the wrong characters in my
client textbox.

This is my SendKeys statement:
SendKeys.Send(MyString)
Thanks in advance,

davidm

Jul 27 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The docs for SendKeys.Send says that you should avoid it in applications
intended for international use since it can lead to unpredictable results.
Guess you just proved that :-(.

That being said, I have successfully used it with a bunch of different
keyboard layouts. However I only sent international characters, so I guess
it depends on what characters you're actually trying to send. Do you have to
send the actual keystrokes? If all you want to do is set the text in the
textbox there are other ways (see WM_SETTEXT)

/claes
<da******@hotmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
Hi,

I'm experiencing a problem when using the VB SendKeys method. I'm
sending characters to a textbox in another application. It works fine
when the Windows Input Languages on both apps are set to English, but
if they are set to say German, I'm getting the wrong characters in my
client textbox.

This is my SendKeys statement:
SendKeys.Send(MyString)
Thanks in advance,

davidm

Jul 28 '06 #2

P: n/a
That should say "...I only sent standard English characters (i.e. 7-bit
ASCII)..."

/claes

"Claes Bergefall" <lo*****@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
The docs for SendKeys.Send says that you should avoid it in applications
intended for international use since it can lead to unpredictable results.
Guess you just proved that :-(.

That being said, I have successfully used it with a bunch of different
keyboard layouts. However I only sent international characters, so I guess
it depends on what characters you're actually trying to send. Do you have
to send the actual keystrokes? If all you want to do is set the text in
the textbox there are other ways (see WM_SETTEXT)

/claes
<da******@hotmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
>Hi,

I'm experiencing a problem when using the VB SendKeys method. I'm
sending characters to a textbox in another application. It works fine
when the Windows Input Languages on both apps are set to English, but
if they are set to say German, I'm getting the wrong characters in my
client textbox.

This is my SendKeys statement:
SendKeys.Send(MyString)
Thanks in advance,

davidm


Jul 28 '06 #3

P: n/a
Thanks for your response!

yes I do want to send the actual keystrokes in order to simulate a
physical keyboard.

Usually only 2-3 ASCII characters display incorrectly when using
non-English layouts. I just thought there may be a workaround for this
problem.

But I might have to resort to the 'keybd_event' API call which I would
like to avoid because SendKeys works great in all other aspects of our
application such as sending text to a textbox within the same
application.

davidm

Jul 28 '06 #4

P: n/a
"da******@hotmail.com" wrote:
Hi,

I'm experiencing a problem when using the VB SendKeys method. I'm
sending characters to a textbox in another application. It works fine
when the Windows Input Languages on both apps are set to English, but
if they are set to say German, I'm getting the wrong characters in my
client textbox.
You need to change the keyboard layout of the sending application to match
the keyboard layout of the focused application.

We offer a .NET component FREE for non-commercial use that will work great
with non-English keyboards (except for complex keyboards which require IME):

http://www.mini-tools.com/goto/input

--
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com

Aug 1 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.