您的位置:首页 > 编程语言 > C语言/C++

VC++环境下获取当前输入法名称

2009-06-02 11:06 525 查看
CString GetCurrentIme()
{
//LPDWORD pId;
DWORD thId;
//DWORD currentThId;
HKL hkl;
LPSTR buffer;
buffer=new char[255];
::memset(buffer,0,255);
thId=::GetWindowThreadProcessId(gFocus,NULL);
//currentThId=::GetCurrentThreadId();
//::AttachThreadInput(currentThId,thId,TRUE);
hkl=::GetKeyboardLayout(thId);
if (::ImmIsIME(hkl))
{
::ImmGetDescription(hkl,buffer,255);
}
else
{
::ImmGetDescription(hkl,buffer,255);
}
//::MessageBox(NULL,buffer,"aaa",MB_OK);
return buffer;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: