473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

SendKeys problem when using Non-English Windows keyboard layouts

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
4 4044
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: NotGiven | last post by:
WHen I use php's mail() function, the recipient sees the hosting userID - NOT GOOD!. Are there any settings I can change or code it a different way? Thanks.
16
by: Dave Smithz | last post by:
Hi, In summary: I want to a form to submit information via a HTTP POST, however, when using Internet Explorer I want to be able to use the back button and all the information retained....
5
by: Andrew James | last post by:
Gentlemen, I'm running into a problem whilst testing the parsing of a language I've created with TPG . It seems that for some reason, TPG balks when I try to parse an expression whose first...
3
by: Steven K | last post by:
Hello, I am using an asp page (upload.asp) to gather information and to upload files to the web server using SoftArtisans SAUpload Tool. In the first page (upload.asp), I have a form for...
2
by: Ash | last post by:
Hi, I'm working on an application that takes csv files then converts it to XML. It then write the XML to a msmq where another service is reading the queue and sends it to the DB. My question...
61
by: Christoph Zwerschke | last post by:
On the page http://wiki.python.org/moin/Python3%2e0Suggestions I noticed an interesting suggestion: "These operators ≤ ≥ ≠ should be added to the language having the following meaning: ...
1
by: Ignoramus534 | last post by:
Does g++ provide any sorts of warnings when a non-virtual function is overridden? I know that it is a legal thing to do in C++, but for us it is always a wrong thing to do. Example class...
4
by: crazy_jutt | last post by:
hi all, i heard that db2 ignores indexes when using any column function on the column which has index on it. but i have seen db2 using indexes even when using column function. what is the...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
0
by: rote | last post by:
I have a project i created using TableAdapters(Datasets with .xsd) and everything works well on my PC. But when i create a websetup project and deploy it to another server. I keep getting Error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.