Sending non-Latin characters using SendKeys : Automation API

Sending non-Latin characters using SendKeys

Class library usage, coding and language questions.

Sending non-Latin characters using SendKeys

Postby andylee » Tue Aug 19, 2008 2:50 pm

Hi,

I have performed the following test using non-Latin characters but I'm not getting the correct characters to appear correctly in the edit box for Notepad

string text = "воздушной";
Ranorex.Form notepad =
Ranorex.Application.StartWindowsApplication("C:\\Windows\\system32\\notepad.exe", "");
Ranorex.Application.Sleep(1000);
Ranorex.Control editBox = notepad.FindClassName("Edit");
editBox.SendKeys(text);

Sending "воздушной" results in "?????????" being received.

Is there a workaround if Unicode support is not available?

Cheers,
Andy
andylee
 
Posts: 4
Joined: Tue Aug 19, 2008 2:42 pm

Postby Support Team » Fri Aug 22, 2008 5:19 pm

The easiest workaround is using the System.Windows.Forms.SendKeys.SendWait(string) method instead of the Ranorex.Control.SendKeys method. You just need to assure that the notepad application is activated and the editBox is focused:

Code: Select all
// old code
//editBox.SendKeys(text);

// new code
editBox.Focus();
System.Windows.Forms.SendKeys.SendWait(text);


Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Thanks!

Postby andylee » Tue Aug 26, 2008 12:56 pm

Thank you very much.
Works very well!!

Cheer,
Andy
andylee
 
Posts: 4
Joined: Tue Aug 19, 2008 2:42 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron