1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| unit RichEdit_TextServices;
interface
uses Windows, ActiveX, RichEdit, IMM;
const
SID_ITextHost = '{c5bdd8d0-d26e-11ce-a89e-00aa006cadc5}';
SID_ITextServices = '{8d33f740-cf58-11ce-a89d-00aa006cadc5}';
IID_ITextHost: TGUID = SID_ITextHost;
IID_ITextServices: TGUID = SID_ITextServices;
type
PCharFormatW = ^TCharFormatW;
PParaFormat = ^TParaFormat;
TSizeL = TSize;
TRectL = TRect;
const
TXTBIT_ALLOWBEEP = $800;
type
{$MINENUMSIZE 4}
TTxtBackStyle = (txtBack_Transparent, txtBack_Opaque);
TTxtView = (txtView_Active, txtView_Inactive);
TTxDrawCallback = function(param: DWord): Bool; stdcall;
ITextServices = interface
[SID_ITextServices]
function TxSendMessage(msg: UInt; wParam: wParam; lParam: lParam; out plresult: lResult): HResult; stdcall;
function TxDraw(dwDrawAspect: DWord; lindex: LongInt; pvAspect: Pointer; ptd: PDVTargetDevice; hdcDraw, hicTargetDev: HDC; const lprcBounds, lprcWBounds: TRectL; const lprcUpdate: TRect; pfnContinue: TTxDrawCallback; dwContinue: DWord; lViewID: TTxtView): HResult; stdcall;
function TxGetHScroll(out plMin, plMax, plPos, plPage: LongInt; out pfEnabled: Bool): HResult; stdcall;
function TxGetVScroll(out plMin, plMax, plPos, plPage: LongInt; out pfEnabled: Bool): HResult; stdcall;
function OnTxSetCursor(dwDrawAspect: DWord; lindex: LongInt; pvAspect: Pointer; ptd: PDVTargetDevice; hdcDraw, hicTargetDev: HDC; const lprcClient: TRect; x, y: Integer): HResult; stdcall;
function TxQueryHitPoint(dwDrawAspect: DWord; lindex: LongInt; pvAspect: Pointer; ptd: PDVTargetDevice; hdcDraw, hicTargetDev: HDC; const lprcClient: TRect; x, y: Integer; out pHitResult: DWord): HResult; stdcall;
function OnTxInPlaceActivate(const prcClient: TRect): HResult; stdcall;
function OnTxInPlaceDeactivate: HResult; stdcall;
function OnTxUIActivate: HResult; stdcall;
function OnTxUIDeactivate: HResult; stdcall;
function TxGetText(out pbstrText: TBStr): HResult; stdcall;
function TxSetText(pszText: PWideChar): HResult; stdcall;
function TxGetCurTargetX(out px: LongInt): HResult; stdcall;
function TxGetBaselinePos(out pBaselinePos: LongInt): HResult; stdcall;
function TxGetNaturalSize(dwAspect: DWord; hdcDraw, hicTargetDev: HDC; ptd: PDVTargetDevice; dwMode: DWord; const psizelExtent: TSizeL; var pwidth, pheight: LongInt): HResult; stdcall;
function TxGetDropTarget(out ppDropTarget: IDropTarget): HResult; stdcall;
function OnTxPropertyBitsChange(dwMask, dwBits: DWord): HResult; stdcall;
function TxGetCachedSize(out pdwWidth, pdwHeight: DWord): HResult; stdcall;
end;
ITextHost = interface
[SID_ITextHost]
function TxGetDC: HDC; stdcall;
function TxReleaseDC(hdc: HDC): Integer; stdcall;
function TxShowScrollBar(fnBar: Integer; fShow: Bool): Bool; stdcall;
function TxEnableScrollBar(fuSBFlags, fuArrowFlags: Integer): Bool; stdcall;
function TxSetScrollRange(fnBar: Integer; nMinPos: LongInt; nMaxPos: Integer; fRedraw: Bool): Bool; stdcall;
function TxSetScrollPos(fnBar, nPos: Integer; fRedraw: Bool): Bool; stdcall;
procedure TxInvalidateRect(const prc: TRect; fMode: Bool); stdcall;
procedure TxViewChange(fUpdate: Bool); stdcall;
function TxCreateCaret(hbmp: hBitmap; xWidth, yHeight: Integer): Bool; stdcall;
function TxShowCaret(fShow: Bool): Bool; stdcall;
function TxSetCaretPos(x, y: Integer): Bool; stdcall;
function TxSetTimer(idTimer, uTimeout: UInt): Bool; stdcall;
procedure TxKillTimer(idTimer: UInt); stdcall;
procedure TxScrollWindowEx(dx, dy: Integer; const lprcScroll, lprcClip: TRect; hrgnUpdate: HRgn; fuScroll: UInt); stdcall;
procedure TxSetCapture(fCapture: Bool); stdcall;
procedure TxSetFocus; stdcall;
procedure TxSetCursor(hcur: hCursor; fText: Bool); stdcall;
function TxScreenToClient(var lppt: TPoint): Bool; stdcall;
function TxClientToScreen(var lppt: TPoint): Bool; stdcall;
function TxActivate(out lpOldState: LongInt): HResult; stdcall;
function TxDeactivate(lNewState: LongInt): HResult; stdcall;
function TxGetClientRect(out prc: TRect): HResult; stdcall;
function TxGetViewInset(out prc: TRect): HResult; stdcall;
function TxGetCharFormat(out ppCF: PCharFormatW): HResult; stdcall;
function TxGetParaFormat(out ppPF: PParaFormat): HResult; stdcall;
function TxGetSysColor(nIndex: Integer): TColorRef; stdcall;
function TxGetBackStyle(out pstyle: TTxtBackStyle): HResult; stdcall;
function TxGetMaxLength(out pLength: DWord): HResult; stdcall;
function TxGetScrollBars(out pdwScrollBar: DWord): HResult; stdcall;
function TxGetPasswordChar(out pch: {Wide}Char): HResult; stdcall;
function TxGetAcceleratorPos(out pcp: LongInt): HResult; stdcall;
function TxGetExtent(out lpExtent: TSizeL): HResult; stdcall;
function OnTxCharFormatChange(const pcf: TCharFormatW): HResult; stdcall;
function OnTxParaFormatChange(const ppf: TParaFormat): HResult; stdcall;
function TxGetPropertyBits(dwMask: DWord; out pdwBits: DWord): HResult; stdcall;
function TxNotify(iNotify: DWord; pv: Pointer): HResult; stdcall;
function TxImmGetContext: hIMC; stdcall;
procedure TxImmReleaseContext(himc: hIMC); stdcall;
function TxGetSelectionBarWidth(out lSelBarWidth: LongInt): HResult; stdcall;
end;
implementation
end. |
Partager