[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

WinXP/WinXP Embedded API to change IME

Posted on 2009-05-04
3
Medium Priority
?
576 Views
Last Modified: 2013-12-14
Hi,

I am looking for an API on WinXP to switch between installed IME's. The scenario is, to be able to plug in a langauge keyboard (say Spanish) and change the IME by clicking on a 'language name button' on the UI (say button named Spanish)

Thanks
0
Comment
Question by:manavsharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:mannujam
ID: 24312740
You can use keybd_event for switching in between installed ime
Code:-
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), 0, 0);
keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), 0, 0);
keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP, 0);      

0
 

Accepted Solution

by:
manavsharma earned 0 total points
ID: 24312817
Thanks for the reply mannujam. I was trying to change the locale/ IME (which falls under the locale).
I found that there is an api named, 'SystemParametersInfo' which allows us to make settings on system level. In my case, I had to go to Control Panel > Regional Settings > and then switch between installed locales under Language tab. This could finally be achieved programatically as shown in the code:
// testing_SystemParametersInfo.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include "windows.h"
 
 
int _tmain(int argc, _TCHAR* argv[])
{
	HKL hLangId = 0;
	bool isFine;
	DWORD errorCode;
 
	errorCode = GetLastError();
 
	isFine = SystemParametersInfo(SPI_GETDEFAULTINPUTLANG, 0, &hLangId, 0);
 
	errorCode = GetLastError();
 
	HKL spanishLanguage = (HKL) (0x040a0c0a);
 
	isFine = SystemParametersInfo(SPI_SETDEFAULTINPUTLANG, 0, &spanishLanguage, 0);
 
	errorCode = GetLastError();
 
	return 0;
}

Open in new window

0
 
LVL 2

Expert Comment

by:mannujam
ID: 24313241
OK,  that'a fine
I thought  for switching between installed IME's  (langauge keyboard / LAnguage bar) shown nin staus bar,
SPI_(GET/SET)DEFAULTINPUTLANG  works fine for sublocale or locale


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question