如题

解决方案 »

  1.   

    WM_IME_COMPOSITION         当用户改变了编码状态时,发送此消息WM_IME_COMPOSITION    应用程序可以通过调用ImmGetCompositionString获取新的编码状态。wChar= wParam;      最后输入到编码窗口的2字节的DBCS字符lAttribute= lParam;   当前编码的含义。lAttribute可取下列值得组合:值 含义 
     
    GCR_ERRORSTR 修正错误 
    GCR_INFORMATIONSTR 修正信息串 
    GCS_COMPATTR 修正编码串属性. 
    GCS_COMPCLAUSE 修正编码信息. 
    GCS_COMPREADATTR 修正读入串的属性 
    GCS_COMPREADCLAUSE 修正读入串的属性. 
    GCS_COMPREADSTR 修正读入串。  
    GCS_COMPSTR 修正当前的编码  
    GCS_CURSORPOS 修正当前编码的光标位置. 
    GCS_DELTASTART 修正当前编码的开始位置 
    GCS_RESULTCLAUSE 修正结果串的信息.  
    GCS_RESULTREADCLAUSE 修正读入串的信息.  
    GCS_RESULTREADSTR 修正读入串.  
    GCS_RESULTSTR 修正编码结果串.  
    CS_INSERTCHAR 在当前位置插入一个字符 
    CS_NOMOVECARET 替换结果串 
      

  2.   

    procedure WMImeComposition(var Msg: TMessage); message WM_IME_COMPOSITION;
      

  3.   

    to jacket008
    用sendmessage上面消息给个例子好吗?就一句
      

  4.   

    procedure WMImeComposition(var Msg: TMessage); message WM_IME_COMPOSITION;
    procedure TSeCustomEdit.WMImeComposition(var Msg: TMessage);
    var
     IMC               : HIMC;
     Buff              : WideString;
     i                 : integer;
    begin
     if Msg.lParam and GCS_RESULTSTR <> 0 then
     begin
       IMC := ImmGetContext(Handle);
       if IMC <> 0 then
       begin
         try
           { Get the result string }
           SetLength(Buff, ImmGetCompositionStringW(IMC, GCS_RESULTSTR, nil, 0) div
             SizeOf(WideChar));
           ImmGetCompositionStringW(IMC, GCS_RESULTSTR, PWideChar(Buff),
             Length(Buff) * SizeOf(WideChar));
         finally
           ImmReleaseContext(Handle, IMC);
         end;     { Insert char messages for each char in string }
         for i := 1 to Length(Buff) do
           InsertChar(Buff[i]);     Msg.Result := 0;
         Exit;
       end;
     end; inherited;
    end;