Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi...

I am using Sendkeys.SendWait method in my project for sending characters, using unicode code points, to the Office Applications in Windows XP, Windows Vista and Windows 7.

In this method, the unicode code point for Devnagari Characters are working nicely but the unicode code point (u002C) of English Symbol Comma ( , ) is not working in Windows Vista and Windows 7 while it is working properly in Windows XP.

It generates an InvalidArgumentException (Queue Empty) for the code point of Comma in Vista and 7.

Could anyone tell me that why it is throwing an error only for Comma in Windows Vista and Windows 7?

Thanks.
Posted
Updated 28-May-21 23:28pm

Make sure wheather you are using the same type of keyboard configuration or change the keypad configurations from control panel and try again.
 
Share this answer
 
Comments
shilky 5-Oct-10 1:25am    
Thanks for the answer

but I am doing nothing with the keyboard configuration.

I am building an windows application (using C#) in .Net 2.0
and using the SendKeys.SendWait() to send a Unicode character point to the foreground screen .

The problem which I am facing is that when I run this application (which sends Unicode point (u002c)) in Windows XP it is running good.

but in Windows Vista and Windows 7 it fails in all ways.
Be Yourself 15-Oct-10 9:43am    
I dont have any idea maybe the char point to the foreground screen U R sending in VISTA does not support the char U are sending..
Be Yourself 15-Oct-10 9:47am    
I think it should work fine.
Try Using My.Computer.Keyboard.SendKeys(",", True) The syntax of code is My.Computer.Keyboard.SendKeys(keys ,wait)
I think it should work fine.
 
Share this answer
 
How to send unicode text from VB6 application to other application:

I found that VB6 Sendkeys and Windows keybd_event api do not support unicode character.

However, I outline below a clumsy way to send out unicode strings from VB6 application to other application:

vb6 > Projects > References > Microsoft ActiveX object 6.1 Library

declare a variable as: Dim FileHdl as New ADODB.stream

Open a txt_filepath for writeover as a ADODB.stream represented by the stream handle, FileHdl

During the file opening, set FileHdl.charset = "utf-8"

Now,
1. write the unicode string through FileHdl.
2. save the txf file and close the stream handle FileHdl
3. Shell "Notepad.exe txt_filepath"
4. Sendkeys "+{end}" ' shift end to highlight the unicode text
5. Sendkeys "^c" ' ctrl c to copy the highlighted text
6. Sendkeys "%{f4}" ' alt f4 to close Notepad
7. activate the application you want to receive unicode text
8. Sendkeys "^v" ' ctrl v to paste the copied unicode text

job done
 
Share this answer
 
Comments
CHill60 2-Jun-21 11:22am    
You resurrected an 11 year old post just to post some off-topic stuff? The post is tagged .NET ... NOT VB6
Member 15221608 2-Jun-21 20:58pm    
It does not matter whether it be VB6 or .Net Visual Studio. The crux is that neither Sendkeys (implicitly via keybd_event) nor keybd_event itself could serve sending out unicode strings. My outline (I need emphasis an approach proved success) is on how to send out unicode strings while Sendkeys or keybd_event fails.
CHill60 3-Jun-21 3:18am    
Nevertheless, your solution is off-topic for the question asked. It looks like you are suggesting that the OP spends money on out-of-date tech just to send input instead of using built-in .Net functionality.
Instead of resurrecting ancient posts with off-topic solutions write a Tip instead.
Member 15221608 3-Jun-21 9:31am    
As my outline algorithm is too annoying to you and causing you so frustrating, please advise how I could withdraw or delete my outline algorithm.
CHill60 4-Jun-21 3:57am    
It's not your algorithm that is the problem - I suggested you publish a tip rather than resurrect old questions tagged with a different language.
Whether I have successfully done this or not is irrelevant but if I needed to I would probably use InputSimulator 1.0.4[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900