wince 拼音输入法转化成英文输入法 、 获得和设置wince输入法 源码

这篇博客提供了在Windows CE(Wince)平台上进行拼音输入法到英文输入法转换的源码,并涵盖了如何获取和设置Wince输入法的方法。文中使用了包括'sipapi'、'aygshell'和'imm'等库,通过全局变量和函数实现输入法管理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#include "stdafx.h"
#include "Keybd.h"
#include "sipapi.h"
#include "aygshell.h"
#include "imm.h"


#pragma comment (lib,"aygshell.lib")
//-------------------------------------------
// Global Variables and Function Declaration
//-------------------------------------------
HWND m_hWnd;


void IME_Test();
int SipEnumIMProc(IMENUMINFO* pIMInfo);
//add yxchen
CLSID g_SipClsid[20];
int g_index=0;
int g_nIMs = 0;

void   IME_Chs2Eng(HWND hwnd);

int SipEnumIMProc(IMENUMINFO* pIMInfo)
{
if (g_index < g_nIMs)
       {
              g_SipClsid[g_index] = pIMInfo->clsid;
              g_index++;
              return g_index;
       }
       g_index = 0;
       return 0;
}
// GET  input method
void IME_Test()
{
int index=0;
TCHAR szBuffer[10];
HWND hWnd;


g_nIMs = SipEnumIM(NULL);


IMENUMPROC pEnumIMProc = SipEnumIMProc;


    index=SipEnumIM(pEnumIMProc);  




// wsprintf(szBuffer,L"%d",index);
// MessageBox(NULL,szBuffer,_T(""),MB_OK);


   for(int i=0 ;i< 3;i++)
   {
SipShowIM(SIPF_ON);
SipSetCurrentIM(&g_SipClsid[2]);
Sleep(2000);
SipShowIM(SIPF_OFF);
Sleep(1000);
       
    }


}
void   IME_Chs2Eng(HWND hwnd)
{
    HKL   hkl   =   GetKeyboardLayout(0);
    if (ImmIsIME(hkl))
        ImmSimulateHotKey(hwnd, IME_CHOTKEY_SYMBOL_TOGGLE);
}
void   IME_Eng2Chs(HWND hwnd)
{
    HKL   hkl   =   GetKeyboardLayout(0);
    if (!ImmIsIME(hkl))
        ImmSimulateHotKey(hwnd, IME_CHOTKEY_IME_NONIME_TOGGLE);
}


int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR    lpCmdLine,
int       nCmdShow)
{
HWND   hWnd   =   GetForegroundWindow();  ; 
if(hWnd   ==   NULL) 

return   0; 
}


HWND hwndChild = ::GetWindow(hWnd, GW_CHILD);   
while(hwndChild)   
{   
     SendMessage(hWnd, 0x287, 0x30, 0x0);
     hwndChild = ::GetWindow( hwndChild, GW_HWNDNEXT);   
}
return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值