0

I had some trouble to adapt a windows 7 application for windows 8. The issue was windows 8 having a global input method on windows 8.

I found that the control panel setting "Let me set a different input method for each app Windows" solved my problem (Set Windows 8 to per-application input language mode).

Now my question is : where can I find this setting in the windows 8 registry ?

I would like to retrieve this key in my application..

2

This setting is stored in HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask. The registry value itself is a binary value that represents a bitmask of various settings. Its format is documented here

Unfortunately this document is a bit oudated and does not contain information about this particular setting. By experimenting with this value I have found that the settins is stored in bit 32. When this bit is on, input switches for each application separately.

Example of HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask with setting on:
9e 1e 07 80 92 00 00 00
With setting off:
9e 1e 07 80 12 00 00 00 

Here is a Powershell script example to turn it on:

$prefMask = (Get-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name 'UserPreferencesMask').UserPreferencesMask
if (($prefMask[4] -band 0x80) -eq 0) {
  $prefMask[4] = ($prefMask[4] -bor 0x80)
  New-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name 'UserPreferencesMask' -Value $prefMask -PropertyType ([Microsoft.Win32.RegistryValueKind]::Binary) -Force | Out-Null
}

Was tested on quite a bunch of win8.1 machines (both x86 and x64) and appears to work as expected.

Note that the setting takes effect immediately, but displays wrong in language panel settings dialog. So you need to logoff and logon back for panel settings to pick up the change.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.