wince 拼音IME轉化成英文IME 、 獲得和設定winceIME 源碼

來源:互聯網
上載者:User

#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;
}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.