Language changing, desperate

R

rmanchu

hi

someone please help me.

how to change the windows language with API calls to windows XP?

i need API calls because the language i'm using (Divehi, complex RTL)
though supported in WinXP is not supported in Office2003 (thus Access)
=> not in MsoAppLanguageID defined languages.

testing reveals that if i manually change the windows language, then
Access data entry works as expected. now i want to automaticvaly change
the windows language when certain fields are entered on a form.

please help

riyaz
 
T

TC

That's a very specialized question.

I've spent quite some time looking for relevant information, and I can
not find anything.

I suggest you post again in:
http://groups.google.com/group/microsoft.public.dotnet.internationalization

It is not on-topic for that group, so you should apologise for posting
an offtopic question. Ask if there is a better group where you could
post it.

However, there are lots of very knowledgeable folks in that group, and
someone might take pity on you, and come to your aid!

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
R

rmanchu

thanx for replying. have found the solution
for info: posting back for those having a similar problem, found the
solution:

solution: (its self explanatory - change as needed for diff. languages)


Option Compare Database
Option Explicit

Private Declare Function GetKeyboardLayout Lib "user32" (ByVal IdThread
As Long) As Long
Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL
As Long, ByVal flags As Long) As Long

Private Const KLF_REORDER = &H8
Private Const lang_Divehi_Phonetic = 73729125
Private Const lang_US_English = 67699721

Private CurrentLanguage As Long

Public Function eventFieldGotFocus() As Boolean
CurrentLanguage = GetKeyboardLayout(0)
Call ActivateKeyboardLayout(lang_Divehi_Phonetic, KLF_REORDER)
eventFieldGotFocus = True
End Function

Public Function eventFieldLostFocus() As Boolean
Call ActivateKeyboardLayout(CurrentLanguage, KLF_REORDER)
eventFieldLostFocus = True
End Function
 
T

TC

Wow, well done!

Are you sure that the correct characters are stored in the database,
from that field /and/ the other ones? That is, doesall of the data
display back correctly, afterwards?

I gues it must do, or you would have noticed by now!

Cheers,
TC (MVP Access)
http://tc2.atspace.com
 
R

rmanchu

TC said:
Are you sure that the correct characters are stored in the database,
from that field /and/ the other ones? That is, doesall of the data
display back correctly, afterwards?

yup it works fine (i'm guessing u r asking if i'm using
NCHAR/NVARCHAR/NTEXT).

i did find a bug in Access 2003 going back all the way to Access 2000.

Access form textboxes only send 256 characters for VARCHAR(>256) :(
solution is to use TEXT/NTEXT instead of CHAR/VARCHAR/NCHAR/NVARCHAR

not elegant at all. :(

riyaz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top