WINCE使中文IMEstatus window不顯示的一些方法

來源:互聯網
上載者:User

WINCE下一般都沒有鍵盤做為輸入,所以如果要輸入漢字的話,方法一是在IMEdll中彈出SIP軟鍵盤來按鍵,方法二當然就是手寫輸入了。
我們用的是方法一,OS固化IME後,從開機,IME的status window就一直在,因為一直都有IMN_OPENSTATUSWINDOW訊息通知IMEDLL開啟status window。
這時就要想法隱藏掉tatus window了,
方法一:
HIMC ImmAssociateContext(
  HWND hWnd,
  HIMC hIMC
);
在OnInitDialog或初始化視窗時調用ImmAssociateContext(GetSafeHwnd(), NULL); 把hIMC置空,可以隱藏該視窗的status window。
方法二:
BOOL ImmDisableIME(
  DWORD idThread
);
ImmDisableIME在WINCE下參數只能用0。ImmDisableIME(0);
該方法使該進程內都禁用IME,而不像方法一是使一個視窗不用IME。
要注意的是:ImmDisableIME要在該進程建立任何視窗前調用才會成功。所以一個好地方是CWinApp的InitInstance。

不知道有沒有這樣的方法,讓WINCE一開機,沒有IME視窗,到我要用IME時能調出IME視窗,好象這樣才是最好的辦法。

另外windows禁用IME的情況,可能是一個edit或某些edit禁用IME,這樣的解決方案是:
http://topic.csdn.net/t/20050913/19/4267382.html
HIMC   m_hImc;         //   全域或者成員變數  
   
//   Function   for   Disabling   IME  
void   CMyDialog::DisableIME()  
{  
  HWND   hWnd   =   GetDlgItem(IDC_EDIT1)->m_hWnd;  
  if   (hWnd   &&   IsWindow(hWnd))  
  {  
   //   Get   input   context   for   backup.    
   m_hImc   =   ImmGetContext(hWnd);  

   //   Remove   association   the   testing    
   if   (m_hImc)  
   ImmAssociateContext(hWnd,   NULL);  

   //   Release   input   context  
   ImmReleaseContext(hWnd,   m_hImc);  
   ::SetFocus(hWnd);  
  }  
}  

//   Function   for   Enabling   IME  
void   CMyDlg::EnableIME()    
{  
  HWND   hWnd   =   GetDlgItem(IDC_EDIT1)->m_hWnd;  
  if   (hWnd   &&   IsWindow(hWnd))  
  {  
  //   Enable   IME  
  if   (m_hImc)  
  {  
   //   Associate   the   input   context   with   testing   window  
   ImmAssociateContext(hWnd,   m_hImc);  
   m_hImc   =   NULL;  
  }  

  ::SetFocus(hWnd);  
  }  

 

本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/albertkong/archive/2009/06/06/4244426.aspx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.