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
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.
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.
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
D:\Program Files\Microsoft Visual Studio\VC98\Include\IMM.H
打开却没有找到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.
我要的是这个,DELPHI的Imm.pas(把Imm.h翻译成pascal)没有定义,现在我要用这
个消息,所以我只有自己定义它。
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.