Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

probleme of changing language

Status
Not open for further replies.

ahmed1973

Programmer
Jan 29, 2013
42
DZ
Hi
Is there anyone knows how to fix the language in a specific textbox.for instance when i click on the textbox i can write on this text box with the language I desired.
 
The language setting you see at the bottom (it's called taskbar and on the right side systray), is merely setting the keyboard layout. You can do this with

Code:
DECLARE INTEGER ActivateKeyboardLayout IN user32;
    INTEGER hkl,;
    INTEGER Flags
DECLARE INTEGER GetKeyboardLayout IN user32;
    INTEGER idThread

ActivateKeyboardLayout(<<locale identifier for desired language>>,0)

The <<locale identifier for desired language>> is a number you can determine once manually by setting the keyboard layout and then using ? GetKeyboardLayout(_vfp.ThreadID). For example I get 67568647 for German and 67699721 for English. I don't have arabic installed, so I can't tell you that number, but you'll find it out with GetKeyboardLayout.

Nevertheless this isn't everything, that's not sufficient, in thread184-1703098 I already told you, that you also need to set a codepage capable to show the language characters, set RightToLeft and FontCharSet of the textbox additional to activating the keyboard layout, because VFP is no unicode capable programming language.

Bye, Olaf.
 
Olaf,

brilliant!
And do you also have an API to SetKeyboardLayout?

Regards,

Jockey(2)
 
Sorry, Jockey, I don't find SetKeyBoardLayout in the MSDN adn only rudimentary other articles about it on Google. The counterpart to GetKeyboardLayout is ActivateKeyboardLayout, isn't it?

Bye, Olaf.

 
Olaf,

ofcourse! I was misleaded when googling for GetKeyboardLayout.

[tt]
setKeyboard(m.lnKeyboard, .T.) && lnKeyboard is Keyboardinteger
[/tt]

works like a charm.

Regards and Thanks.

Jockey(2)
 
Don't know what you're talking about, I successfully use ActivateKeyBoardLayout(nKeyboardlayout,0), as given in my initial post. Please read, you have to replace the <<locale identifier for desired language>> part of the code. I wrote everythng you need to know already, including how you can get the needed keyboardlayout number.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top