1 Attachment(s)
Change Windows Input Locale or Keyboard Layout Language
Hey Guys :wave:
I have a question regarding Windows Input Locale or Keyboard Layout Language or Language Bar.
As you can see in the screen shot attached when I click on the BLUE button where the arrow points to it shows me a list of languages installed on my PC. I was wondering if there was a way to get that list of installed languages through API and show them in a listbox or something like that.
Also I would like to change it programatically rather than clicking on the tray area and change it.
The reason behind that is the user is using the application through Citrix and they can't directly access system tray while in Citrix so the only way to change something in Windows is through the application they are running.
Hope this all make sense.
Cheers :)
Re: Change Windows Input Locale or Keyboard Layout Language
you need EnumSystemLocales API. see this example by Randy Birch.
Re: Change Windows Input Locale or Keyboard Layout Language
Or run a VNC so the user can access the entire desktop, if that's allowable. (Citrix certainly allows it.)
Re: Change Windows Input Locale or Keyboard Layout Language
Quote:
Originally Posted by Harsh Gupta
you need EnumSystemLocales API. see this
example by Randy Birch.
Thanks Harsh I will have a look at it :)
So how do I pick one from a list and then set it using my program..?
Re: Change Windows Input Locale or Keyboard Layout Language
Quote:
Originally Posted by Al42
Or run a VNC so the user can access the entire desktop, if that's allowable. (Citrix certainly allows it.)
I can't dictate how customer's IT department sets their security :( So VNC is not an options, Citrix is there and there is nothing I can do about it.
Re: Change Windows Input Locale or Keyboard Layout Language
Quote:
Originally Posted by wrack
Thanks Harsh I will have a look at it :)
So how do I pick one from a list and then set it using my program..?
the only way i could think is setting the registry info.
the example gives you all the details about a single language installed and in the registry, the settings are located at: "HKEY_CURRENT_USER\Control Panel\International", and in the right-pane, check the key "slanguage". you need to modify this key to change the language.
but remember that playing with keys could be dangerous, and most people would not use your application if you play with registry. also, possibly what if you are trying to set a particular language which is not installed on client's machine??
Re: Change Windows Input Locale or Keyboard Layout Language
Yeah I have thought about the possibility where I try to install a language which is not installed on client machine but this is not one of those off the selve app u can buy.
The client will have to have a setup we ask them or too bad for them and they are willing to do it aswell so hopefully it wont matter.
The only thing I am not OK with is to change registry setting to change something of native windows functionality..! I was hoping to do this by using API since it's a much better implementation of exposed methods and properties.
Guess I will have to do some more digging.
Thanks for the help :)
Re: Change Windows Input Locale or Keyboard Layout Language
the api may well change the registry anyway, most installed programs make some change to the registry during installation, of couse having permissions to do those things is as much a problem
as long as you save the keys so they can be set back later all is well, unless the machine crashes, while your program is running
Re: Change Windows Input Locale or Keyboard Layout Language
Thanks :)
True but APIs are hopefully very well tested while if I make a change on something where I don't know all the details my project manager will be very uncomfirtalble with that idea; same goes for me.
I am going to do a little more research on if there is a way I can find out exactly what is being changed :)
Re: Change Windows Input Locale or Keyboard Layout Language
there is a program called RegSnap (and others) that you can use to read the registry before and after doing something then it can compare the differences, keys added, deleted or changed
Re: Change Windows Input Locale or Keyboard Layout Language
I have been using RegMon but so far haven't been able to find the correct information. May be the filters I set were wrong.
Re: Change Windows Input Locale or Keyboard Layout Language
regsnap has no filters, it just snapshot the regitry before and after
just google it for plenty places to download
Re: Change Windows Input Locale or Keyboard Layout Language
Thanks :)
I am gonna give it a go right now.