Ranorex

Sending non-Latin characters using SendKeys

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
andylee



Joined: 19 Aug 2008
Posts: 4

PostPosted: Tue Aug 19, 2008 2:50 pm    Post subject: Sending non-Latin characters using SendKeys
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\\no tepad.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
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 485

PostPosted: Fri Aug 22, 2008 5:19 pm    Post subject:
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: click into code to enlarge
// old code
//editBox.SendKeys(text);

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


Regards,
Alex
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
andylee



Joined: 19 Aug 2008
Posts: 4

PostPosted: Tue Aug 26, 2008 12:56 pm    Post subject: Thanks!
Thank you very much.
Works very well!!

Cheer,
Andy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum