Monday, January 23, 2017

Refresh Language Bar in Windows Vista/7 programatically

Im trying to configure the Language Bar (the language switcher in the systray which appears whan you have multiple input languages installed) for our users.


language bar


I can easily add new languages using regkeys below HKCU,
but the problem is that the user has to relogin or reboot his computer to see the effect.


The keys i use (im writing them with an active setup) are in
"HKEY_CURRENT_USER\Keyboard Layout\Preload"
below that key are name/values of the type REG_SZ.


Usually there are already keys like
"1"="0000407"
"2"="0000409"
which means the user has German and English keyboard layout installed,
if i want to add, lets say italian, i would add the key
"3"="0000410".
after the next logoff/login the change is visible to the user.


now what i already tried is sending various windows messages, like WM_SETTINGCHANGE or the "RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters" command. but no usefull result so far.


im running out of ideas here,
making hundreds of users logoff/logon wouldn't be so great :/


i also thought of automating mouseclicks (e.g. with autoit), but that usually causes more trouble than it does any good.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...