如题,我在控制输入法的时候要用到这个消息,从MSDN上查到了这个消息,但没查到定义这个消息的头文件,也不知它的值。(不好意思,本人平常用DELPHI,C++只会一点语法)。

解决方案 »

  1.   

    我是在DELPHI中使用,但在DELPHI版问没得到有效解答,这个消息在DELPHI的imm.pas单元没有定义,所以我只有自己定义啦.
      

  2.   

    Microsoft Windows CE 3.0   IMC_GETCONVERSIONMODE
    This message is sent by an application to an IME window to obtain the current conversion mode. The window retrieves the current conversion mode from the current input context.msg = (UINT) WM_IME_CONTROL;
    wParam = (WPARAM) IMC_GETCONVERSIONMODE;
    lParam = 0;
    Return ValuesReturns a combination of IME conversion mode values.RequirementsRuns on Versions Defined in Include Link to 
    Windows CE OS 2.1 and later Imm.h     Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.-------------------------------------------------------------------------------- Last updated on Tuesday, July 13, 2004
      

  3.   

    我以前也是用DELPHI的这个消息是在IME是中的吧我这里DELPHI没装,我回家帮你查查
      

  4.   

    这是我从MSDN上查到的,说在Imm.h单元定义的,但我找到
    D:\Program Files\Microsoft Visual Studio\VC98\Include\IMM.H
    打开却没有找到IMC_GETCONVERSIONMODE
      

  5.   

    Platform Builder for Microsoft Windows CE 5.0   IMC_GETCONVERSIONMODE
    This message is sent by an application to an IME window to obtain the current conversion mode. The window retrieves the current conversion mode from the current input context.msg = (UINT) WM_IME_CONTROL;
    wParam = (WPARAM) IMC_GETCONVERSIONMODE;
    lParam = 0;
    Parameters
    lParam 
    Not used. 
    Return Values
    Returns a combination of IME conversion mode values.Requirements
    OS Versions: Windows CE .NET 4.0 and later.
    Header: Imm.h.
      

  6.   

    谢谢各位朋友的热情参与,这个消息我在MSDN上确实找到了,但没有找到它的值呀!
    我要的是这个,DELPHI的Imm.pas(把Imm.h翻译成pascal)没有定义,现在我要用这
    个消息,所以我只有自己定义它。
      

  7.   

    Dephi的,怎么到VC来问了 ^_^
      

  8.   

    unit MainForm;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ExtCtrls, ComCtrls;type
      TfrmMain = class(TForm)
        Memo1: TMemo;
        RichEdit1: TRichEdit;
        procedure Memo1MouseMove(Sender: TObject; Shift: TShiftState; X,
          Y: Integer);
        procedure Memo1KeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure RichEdit1KeyDown(Sender: TObject; var Key: Word;
          Shift: TShiftState);
        procedure RichEdit1MouseMove(Sender: TObject; Shift: TShiftState; X,
          Y: Integer);
      private
        { Private declarations }
        isCanMove: Boolean;
      public
        { Public declarations }
      end;var
      frmMain: TfrmMain;implementation{$R *.DFM}procedure ManipulateControl(Control: TControl; Shift: TShiftState; X, Y, Precision: integer);
    var
      SC_MANIPULATE: Word;
    begin
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的最左侧**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      if (X<=Precision) and (Y>Precision) and (Y<Control.Height-Precision) then
      begin
        SC_MANIPULATE  := $F001;
        Control.Cursor := crSizeWE;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的最右侧**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>=Control.Width-Precision) and (Y>Precision) and (Y<Control.Height-Precision) then
      begin
        SC_MANIPULATE  := $F002;
        Control.Cursor := crSizeWE;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的最上侧**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>Precision) and (X<Control.Width-Precision) and (Y<=Precision) then
      begin
        SC_MANIPULATE  := $F003;
        Control.Cursor := crSizeNS;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的左上角**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X<=Precision) and (Y<=Precision) then
      begin
        SC_MANIPULATE  := $F004;
        Control.Cursor := crSizeNWSE;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的右上角**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>=Control.Width-Precision) and (Y<=Precision) then
      begin
        SC_MANIPULATE  := $F005;
        Control.Cursor := crSizeNESW;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的最下侧**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>Precision) and (X<Control.Width-Precision) and (Y>=Control.Height-Precision) then
      begin
        SC_MANIPULATE  := $F006;
        Control.Cursor := crSizeNS;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的左下角**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X<=Precision) and (Y>=Control.Height-Precision) then
      begin
        SC_MANIPULATE  := $F007;
        Control.Cursor := crSizeNESW;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的右下角**********************************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>=Control.Width-Precision) and (Y>=Control.Height-Precision) then
      begin
        SC_MANIPULATE  := $F008;
        Control.Cursor := crSizeNWSE;
      end
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      //光标在控件的客户区(移动整个控件)******************************************
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      else if (X>5) and (Y>5) and (X<Control.Width-5) and (Y<Control.Height-5) then
      begin
        SC_MANIPULATE  := $F009;
        Control.Cursor := crSizeAll;
      end
      else
      begin
        SC_MANIPULATE := $F000;
        Control.Cursor := crDefault;
      end;
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      if Shift=[ssLeft] then
      begin
        ReleaseCapture;  
        Control.Perform(WM_SYSCOMMAND, SC_MANIPULATE, 0);
      end;
    end;procedure TfrmMain.Memo1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      if isCanMove then
      begin
        ManipulateControl((Sender as TControl), Shift, X, Y, 4);
      end;
    end;procedure TfrmMain.Memo1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if (ssCtrl in Shift) and (Key = Ord('M')) then isCanMove := not isCanMove;
      if isCanMove then
        (Sender as TControl).Hint := '按Ctrl+M停止移动、缩放'
      else
      begin
        (Sender as TControl).Hint := '按Ctrl+M进行移动、缩放';
        (Sender as TControl).Cursor := crDefault;
      end;
    end;procedure TfrmMain.RichEdit1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      if (ssCtrl in Shift) and (Key = Ord('M')) then isCanMove := not isCanMove;
      if isCanMove then
        (Sender as TControl).Hint := '按Ctrl+M停止移动、缩放'
      else
      begin
        (Sender as TControl).Hint := '按Ctrl+M进行移动、缩放';
        (Sender as TControl).Cursor := crDefault;
      end;
    end;procedure TfrmMain.RichEdit1MouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
    begin
      if isCanMove then
      begin
        ManipulateControl((Sender as TControl), Shift, X, Y, 4);
      end;
    end;end.