Search

Native calls to IME fail to work in Windows 7 by Rich Chinnici

Closed
as By Design Help for as By Design

1
0
Sign in
to vote
Type: Bug
ID: 773427
Opened: 12/4/2012 7:57:46 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
We have C# code that uses P/Invoke native calls that works perfectly fine in Windows XP to enable the IME for a particular locale. However, the same code under Windows 7 fails to enable the IME and set it to the desired locale. Therefore the correct charcters are not typed.

I am actually building my project with VS 2010, but that was not a choice below.
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012

Steps to reproduce

I have written a simple test program that can demonstrate the problem, in this example, switching between English and Korean. It has no dependencies on any of our custom code. You can download a ZIP file of the project at the link below. After being built, the same executable will run correctly under Windows XP. It will switch the Korean IME on and off and type the correct characters in the text field. Running under Windows 7, it will fail to switch to the Korean IME and the correct characters are not typed. Running as administrator does not help and no exceptions are thrown.

Our software is a kiosk application that allows the user to switch to the language of their choice. It needs to support many languages, including Korean, Simplified Chinese and Traditional Chinese. The IMEs are used for text entry via our touchscreen keyboard. The kiosk has always used the US English version of the OS. We recently migrated our kiosks from Windows XP to Windows 7. This problem is reproducible on my Windows 7 development machine as well.

For Windows XP, I have the Korean Input System (IME 2002) configured on my system. For Windows 7, I have the Microsoft IME configured.

Mike Feng from MSDN Community Support, who I have had a thread going on this subject, indicates he has reproduced the problem.

https://www.dropbox.com/s/84rdst59fsirq18/IMEtest.zip

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

After being built, the same executable will run correctly under Windows XP. It will switch the Korean IME on and off and type the correct characters. Running under Windows 7, it will fail to switch to the Korean IME. Running as administrator does not help and no exceptions are thrown. (I built the software on my Windows 7 machine.)

Expected results

Selecting the Korean radio button should turn on the Korean IME and Korean characters should be typed. The IME switch can be observed by looking at the language bar icon in the Sys Tray and seeing it switch between EN and KO.
File Attachments
File Name Submitted By Submitted On File Size  
IMEtest.zip 12/4/2012 14 KB
IMEtest.zip 12/4/2012 14 KB
Sign in to post a comment.
Posted by Rich Chinnici on 2/25/2013 at 5:16 AM
Hello,

Thank you for your response, but the Korean Keyboard/IME was already activated on our machines.

This problem was resolved with the help of David Wooden - Senior Escalation Engineer from Microsoft Developer Support. I needed to change the value of the Korean locale ID as follows:

public const string localeKorean = "00000412"; //"e0010412";

The higher order bits being set to something other than zero was causing "undefined behavior". When I corrected the value, everything worked properly.
Posted by Microsoft on 2/21/2013 at 1:54 PM
Thank you for your feedback, Rich.
In order for your sample application to work on Windows7, please activate Korean IME keyboard service. Go to "Control panel", type "input method" in the search box on the right, select "Change keyboards or other input methods" option, as a result a "Region and Language" dialog will appear, please click "Change keyboards..." button in this dialog, as a result "Text Services and Input Languages" dialog will open, click "Add" button to select all desired input languages. Save your changes.
If this issue still reproduces at your end, we would like to investigate it again. Please provide the exact steps/actions to reproduce the problem, reactivate this bug and we will re-investigate.
 
Thanks,
The Windows Forms Product Team
Posted by Microsoft on 12/4/2012 at 10:39 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 12/4/2012 at 8:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.