Changing the default Windows language with Java application -


can change default language of host system (windows xp) java application? if yes, how can it?

you can set default input language using windows systemparametersinfo api.

bool winapi systemparametersinfo(   __in     uint uiaction,   __in     uint uiparam,   __inout  pvoid pvparam,   __in     uint fwinini ); 

using jna easier using jni. invoke api function in user32.dll using jna, create interface:

public interface user32 extends stdcalllibrary {    user32 instance = (user32) native.loadlibrary("user32", user32.class);     bool systemparametersinfo(int uiaction, int uiparam, int[] pint, int fwinini); } 

you determine lcid of language want change to. (here's list msdn.) example, english 0x409. use lcid in call systemparametersinfo:

int lcid = 0x409; final int spi_setdefaultinputlang = 90;  user32.instance.systemparamtersinfo(spi_setdefaultinputlang, 0, new int[] { lcid }, 0); 

and thenn default input language has been changed!


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -