#include <imm.h>

 #pragma comment(lib, "imm32.lib")


 HIMC hImc = ::ImmGetContext( m_hWnd);
 屏蔽输入法
 ::ImmAssociateContext(m_hWnd , NULL);
 ::ImmReleaseContext(m_hWnd , hImc );


 恢复输入法的代码。
 ::ImmAssociateContext(m_hWnd , hImc );

 procedure TForm1.Edit1MouseActivate(Sender: TObject; Button: TMouseButton;
 Shift: TShiftState; X, Y, HitTest: Integer;
 var MouseActivate: TMouseActivate);
 begin
 ImmAssociateContext(Edit1.Handle, 0);//uses IMM
 end;