The function NewExtTextOutW (theDC: HDC. NXStart nYStart: integer; ToOptions:
Longint; P_rect: PRect;
Str: Pwidechar; Count: Longint; Dx: PInteger) : BOOL; Stdcall;
Type
TExtTextOutW=function (theDC: HDC; NXStart nYStart: integer; ToOptions: Longint;
P_rect: PRect; Str: Pwidechar; Count: Longint; Dx: PInteger) : BOOL; Stdcall;
Var
DwBytes: DWORD;
PoOri poDC, poText poMouse: TPoint;
Size: TSize;
Rec, tmprec: TRect;
Abbreviation: Boolean;
NTextLen, uf: integer;
TMPSTR: string;
Hf: HFONT;
Tm: the TEXTMETRIC;
The begin
Hook [fExtTextOutW]. Restore; {pause intercept API, restore the cut function}
Try
TMPSTR:='success'; {I replace strings that will be all intercepted success}
STR:=pwidechar (TMPSTR);
Count:=length (TMPSTR);
GetTextExtentPointW (theDC, Str, Count, Size); {calculates wide high string}
If toOptions<> ETO_GLYPH_INDEX then
ToOptions:=ETO_OPAQUE and ETO_IGNORELANGUAGE; {at first thought it was on this parameter in cheating, I dead, if this parameter is equal to the ETO_CLIPPED, output text will control in temprec area, will not exceed}
Tmprec:=the Rect (nXStart nYStart, nXStart + size. The Width, nYStart + size. The Height); {calculated output string intercepted area size, in fact, this line can not, I am really helpless to do the test, the width of the area change no matter how much, didn't affect the result of the final output}
The finally
{call cut function}
Result:=TExtTextOutW (Hook) [r]. FExtTextOutW OldFunction) (theDC, nXStart, nYStart toOptions, @ tmprec, Str, Count, nil);
end;
Hook [fExtTextOutW] Change; {to intercept API}
end;
CodePudding user response:
Intercept the screenshot beforeIntercept and replacement string content after screenshots
CodePudding user response:
There is a small found that Delphi label not into a static... Did not handle good trouble ah,,,His top a, continue to wait for superior to!