BSOne.SFC/Tocsg.Module/AppCtrl/DLL_AppCtrl/ApiHookDraw.pas

2152 lines
86 KiB
Plaintext

{*******************************************************}
{ }
{ ApiHookDraw }
{ }
{ Copyright (C) 2023 kku }
{ }
{*******************************************************}
unit ApiHookDraw;
interface
uses
Winapi.Windows, System.SysUtils, Vcl.Graphics, System.Classes,
System.Generics.Collections;
type
TFun_BitBlt = function(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC;
XSrc, YSrc: Integer; Rop: DWORD): BOOL; stdcall;
TFun_StretchBlt = function(DestDC: HDC; X, Y, SrcWidth, SrcHeight: Integer; SrcDC: HDC;
XSrc, YSrc, DestWidth, DestHeight: Integer; Rop: DWORD): BOOL; stdcall;
TFun_TransparentBlt = function(DestDC: HDC; X, Y, DestWidth, DestHeight: Integer; SrcDC: HDC;
XSrc, YSrc, SrcWidth, SrcHeight: Integer; dwTransparent: DWORD): BOOL; stdcall;
TFun_StretchDIBits = function(DC: HDC; DestX, DestY, DestWidth, DestHeight, SrcX,
SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo;
Usage: UINT; Rop: DWORD): Integer; stdcall;
TFun_SetDIBitsToDevice = function(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD;
SrcX, SrcY: Integer; nStartScan, NumScans: UINT; Bits: Pointer;
var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
TFun_SetDIBits = function(DC: HDC; Bitmap: HBITMAP; StartScan, NumScans: UINT;
Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall; // 추가 25_1001 10:43:39 kku
TFun_SetROP2 = function(DC: HDC; p2: Integer): Integer; stdcall; // 추가 25_1001 10:43:39 kku
TFun_SetMapperFlags = function(DC: HDC; Flag: DWORD): DWORD; stdcall;
TFun_SetGraphicsMode = function(hdc: HDC; iMode: Integer): Integer; stdcall;
TFun_SetMapMode = function(DC: HDC; p2: Integer): Integer; stdcall;
// 추가 25_1001 10:43:39 kku
TFun_SetWindowOrgEx = function(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
TFun_ModifyWorldTransform = function(DC: HDC; p2: PXForm; p3: DWORD): BOOL; stdcall;
TFun_SelectPalette = function(DC: HDC; Palette: HPALETTE; ForceBackground: Bool): HPALETTE; stdcall;
TFun_SetBkColor = function(DC: HDC; Color: COLORREF): COLORREF; stdcall;
TFun_SetBrushOrgEx = function(DC: HDC; X, Y: Integer; PrevPt: PPoint): BOOL; stdcall;
TFun_SetWorldTransform = function(DC: HDC; p2: PXForm): BOOL; stdcall;
TFun_ExcludeClipRect = function(DC: HDC; LeftRect, TopRect, RightRect, BottomRect: Integer): Integer; stdcall;
TFun_SetTextColor = function(DC: HDC; Color: COLORREF): COLORREF; stdcall;
TFun_CreateHalftonePalette = function(DC: HDC): HPALETTE; stdcall;
TFun_CreateDIBSection = function(DC: HDC; const p2: TBitmapInfo; p3: UINT;
var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall;
TFun_SetBoundsRect = function(DC: HDC; p2: PRect; p3: UINT): UINT; stdcall;
TFun_SetSystemPaletteUse = function(DC: HDC; p2: UINT): UINT; stdcall;
TFun_GetTextCharsetInfo = function(hdc: HDC; lpSig: PFontSignature; dwFlags: DWORD): Integer; stdcall;
TFun_RealizePalette = function(DC: HDC): UINT; stdcall;
TFun_GetGlyphIndicesA = function(DC: HDC; p2: LPCSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
TFun_GetGlyphIndicesW = function(DC: HDC; p2: LPCWSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
TFun_GetFontLanguageInfo = function(DC: HDC): DWORD; stdcall;
TFun_GetCharacterPlacementA = function(DC: HDC; p2: LPCSTR; p3, p4: Integer;
var p5: TGCPResultsA; p6: DWORD): DWORD; stdcall;
TFun_GetCharacterPlacementW = function(DC: HDC; p2: LPCWSTR; p3, p4: Integer;
var p5: TGCPResultsW; p6: DWORD): DWORD; stdcall;
TFun_GetFontData = function(DC: HDC; p2, p3: DWORD; p4: Pointer; p5: DWORD): DWORD; stdcall;
TFun_GetGlyphOutlineA = function(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
TFun_GetGlyphOutlineW = function(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
TFun_ResetDCA = function(DC: HDC; const InitData: TDeviceModeA): HDC; stdcall;
TFun_ResetDCW = function(DC: HDC; const InitData: TDeviceModeW): HDC; stdcall;
TFun_ColorCorrectPalette = function(DC: HDC; p2: HPALETTE; p3, p4: DWORD): BOOL; stdcall;
TFun_SetICMProfileA = function(DC: HDC; Name: LPSTR): BOOL; stdcall;
TFun_SetICMProfileW = function(DC: HDC; Name: LPWSTR): BOOL; stdcall;
TFun_AlphaBlend = function(DC: HDC; p2, p3, p4, p5: Integer; DC6: HDC; p7, p8, p9, p10: Integer; p11: TBlendFunction): BOOL; stdcall;
TFun_SetTextJustification = function(DC: HDC; BreakExtra, BreakCount: Integer): Integer; stdcall;
TFun_ScaleWindowExtEx = function(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
TFun_RestoreDC = function(DC: HDC; SavedDC: Integer): BOOL; stdcall;
TFun_SetMiterLimit = function(DC: HDC; NewLimit: Single; OldLimit: PSingle): BOOL; stdcall;
TFun_CloseFigure = function(DC: HDC): BOOL; stdcall;
TFun_SelectClipPath = function(DC: HDC; Mode: Integer): BOOL; stdcall;
TFun_AbortPath = function(DC: HDC): BOOL; stdcall;
TFun_FrameRgn = function(DC: HDC; hrgn: HRGN; hbr: HBRUSH; Width, Height: Integer): BOOL; stdcall;
TFun_InvertRgn = function(DC: HDC; p2: HRGN): BOOL; stdcall;
TFun_MaskBlt = function(DestDC: HDC; XDest, YDest, Width, Height: Integer; SrcDC: HDC;
XScr, YScr: Integer; Mask: HBITMAP; xMask, yMask: Integer; Rop: DWORD): BOOL; stdcall;
TFun_GetTextMetricsA = function(DC: HDC; var TM: TTextMetricA): BOOL; stdcall;
TFun_GetTextMetricsW = function(DC: HDC; var TM: TTextMetricW): BOOL; stdcall;
TFun_GetTextExtentPoint32A = function(DC: HDC; Str: LPCSTR; Count: Integer; var Size: TSize): BOOL; stdcall;
TFun_GetTextExtentPoint32W = function(DC: HDC; Str: LPCWSTR; Count: Integer; var Size: TSize): BOOL; stdcall;
TFun_GdiComment = function(DC: HDC; p2: UINT; p3: LPSTR): BOOL; stdcall;
TFun_GetCharABCWidthsA = function(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
TFun_GetCharABCWidthsW = function(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
TFun_UpdateColors = function(DC: HDC): BOOL; stdcall;
TFun_OffsetViewportOrgEx = function(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
TFun_OffsetWindowOrgEx = function(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
TFun_OffsetWindowOrgEx2 = function(DC: HDC; X, Y: Integer; var Points): BOOL; stdcall;
TFun_SetDeviceGammaRamp = function(DC: HDC; var Ramp): BOOL; stdcall;
TFun_ColorMatchToTarget = function(DC: HDC; Target: HDC; Action: DWORD): BOOL; stdcall;
TFun_PtVisible = function(DC: HDC; X, Y: Integer): BOOL; stdcall;
TFun_RectVisible = function(DC: HDC; const Rect: TRect): BOOL; stdcall;
TFun_SetPixelFormat = function(DC: HDC; PixelFormat: Integer; FormatDef: PPixelFormatDescriptor): BOOL; stdcall;
TFun_SetStretchBltMode = function(DC: HDC; StretchMode: Integer): Integer; stdcall;
TFun_OffsetClipRgn = function(DC: HDC; XOffset, YOffset: Integer): Integer; stdcall;
TFun_IntersectClipRect = function(DC: HDC; X1, Y1, X2, Y2: Integer): Integer; stdcall;
TFun_SetTextCharacterExtra = function(DC: HDC; CharExtra: Integer): Integer; stdcall;
TFun_EnumICMProfilesA = function(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
TFun_EnumICMProfilesW = function(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
TFun_ExtEscape = function(DC: HDC; p2, p3: Integer; const p4: LPCSTR; p5: Integer; p6: LPSTR): Integer; stdcall;
TFun_EnumFontsA = function(DC: HDC; lpszFace: LPCSTR; fntenmprc: TFNFontEnumProcA; lParam: LPARAM): Integer; stdcall;
TFun_EnumFontsW = function(DC: HDC; lpszFace: LPCWSTR; fntenmprc: TFNFontEnumProcW; lParam: LPARAM): Integer; stdcall;
TFun_EnumFontFamiliesA = function(DC: HDC; p2: LPCSTR; p3: TFNFontEnumProcA; p4: LPARAM): Integer; stdcall;
TFun_EnumFontFamiliesW = function(DC: HDC; p2: LPCWSTR; p3: TFNFontEnumProcW; p4: LPARAM): Integer; stdcall;
TFun_CreateCompatibleDC = function(DC: HDC): HDC; stdcall;
TFun_CreateCompatibleBitmap = function(DC: HDC; Width, Height: Integer): HBITMAP; stdcall;
TFun_SetMetaRgn = function(DC: HDC): Integer; stdcall;
TFun_PlayEnhMetaFile = function(DC: HDC; p2: HENHMETAFILE; const p3: TRect): BOOL; stdcall;
TFun_PlayEnhMetaFileRecord = function(DC: HDC; var p2: THandleTable; const p3: TEnhMetaRecord; p4: UINT): BOOL; stdcall;
///////////////////////////////////
TFun_SetPixel = function(DC: HDC; X, Y: Integer; Color: COLORREF): COLORREF; stdcall;
TFun_SetPixelV = function(DC: HDC; X, Y: Integer; Color: COLORREF): BOOL; stdcall;
TFun_LineTo = function(DC: HDC; X, Y: Integer): BOOL; stdcall;
TFun_PlgBlt = function(DestDC: HDC; const PointsArray; SrcDC: HDC;
XSrc, YSrc, Width, Height: Integer; Mask: HBITMAP; xMask, yMask: Integer): BOOL; stdcall; // 추가 25_1001 10:43:39 kku
TFun_PatBlt = function(DC: HDC; X, Y, Width, Height: Integer; Rop: DWORD): BOOL; stdcall; // 추가 25_1001 10:43:39 kku
TFun_MoveToEx = function(DC: HDC; p2, p3: Integer; p4: PPoint): BOOL; stdcall;
TFun_PolyBezierTo = function(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
TFun_PolyLineTo = function(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
TFun_PolyDraw = function(DC: HDC; const Points, Types; cCount: Integer): BOOL; stdcall;
TFun_Polygon = function(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
TFun_Polyline = function(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
TFun_PolyBezier = function(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
TFun_Rectangle = function(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
TFun_RoundRect = function(DC: HDC; X1, Y1, X2, Y2, X3, Y3: Integer): BOOL; stdcall;
TFun_BeginPath = function(DC: HDC): BOOL; stdcall;
TFun_EndPath = function(DC: HDC): BOOL; stdcall;
TFun_FillPath = function(DC: HDC): BOOL; stdcall;
TFun_FlattenPath = function(DC: HDC): BOOL; stdcall;
TFun_WidenPath = function(DC: HDC): BOOL; stdcall;
TFun_StrokePath = function(DC: HDC): BOOL; stdcall;
TFun_StrokeAndFillPath = function(DC: HDC): BOOL; stdcall;
TFun_SetDCBrushColor = function(DC: HDC; Color: COLORREF): COLORREF; stdcall;
TFun_SetDCPenColor = function(DC: HDC; Color: COLORREF): COLORREF; stdcall;
TFun_SetDIBColorTable = function(DC: HDC; p2, p3: UINT; var RGBQuadSTructs): UINT; stdcall;
TFun_SetTextAlign = function(DC: HDC; Flags: UINT): UINT; stdcall;
TFun_SetBkModeHook = function(DC: HDC; BkMode: Integer): Integer; stdcall; // 추가 25_1001 10:43:39 kku
TFun_GradientFill = function(DC: HDC; Vertex: PTriVertex; NumVertex: ULONG; Mesh: Pointer; NumMesh, Mode: ULONG): BOOL; stdcall;
TFun_FillRect = function(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
TFun_FrameRect = function(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
TFun_ExtFloodFill = function(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
TFun_FloodFill = function(DC: HDC; nXStart, nYStart: Integer; crFill: COLORREF): BOOL; stdcall;
TFun_FillRgn = function(DC: HDC; hrgn: HRGN; hbr: HBRUSH): BOOL; stdcall;
TFun_SetPolyFillMode = function(DC: HDC; PolyFillMode: Integer): Integer; stdcall;
TFun_DrawEscape = function(DC: HDC; p2, p3: Integer; p4: LPCSTR): BOOL; stdcall;
TFun_PaintRgn = function(DC: HDC; RGN: HRGN): BOOL; stdcall;
TFun_SetColorAdjustment = function(DC: HDC; const p2: TColorAdjustment): BOOL; stdcall;
TFun_SetArcDirection = function(DC: HDC; Direction: Integer): Integer; stdcall;
TFun_SetViewportExtEx = function(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
TFun_SetViewportOrgEx = function(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
TFun_ScaleViewportExtEx = function(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall; // 추가 25_1001 10:43:39 kku
TFun_SetWindowExtEx = function(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
TFun_SelectClipRgn = function(DC: HDC; Region: HRGN): Integer; stdcall;
TFun_ExtSelectClipRgn = function(DC: HDC; Region: HRGN; Mode: Integer): Integer; stdcall; // 추가 25_1001 10:43:39 kku
TFun_SetICMMode = function(DC: HDC; Mode: Integer): Integer; stdcall;
TFun_SetColorSpace = function(DC: HDC; ColorSpace: HCOLORSPACE): BOOL; stdcall;
TFun_SaveDC = function(DC: HDC): Integer; stdcall;
TFun_AngleArc = function(DC: HDC; p2, p3: Integer; p4: DWORD; p5, p6: Single): BOOL; stdcall;
TFun_ArcTo = function(DC: HDC; RLeft, RTop, RRight, RBottom: Integer; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
TFun_PolyPolyline = function(DC: HDC; const PointStructs; const Points; p4: DWORD): BOOL; stdcall;
TFun_Ellipse = function(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
TFun_LPtoDP = function(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall; // 추가 25_1001 10:43:39 kku
TFun_DPtoLP = function(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall; // 추가 25_1001 10:43:39 kku
TFun_SelectObject = function(DC: HDC; p2: HGDIOBJ): HGDIOBJ; stdcall; // 추가 25_1001 10:43:39 kku
TFun_Chord = function(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
TFun_Arc = function(hDC: HDC; left, top, right, bottom, startX, startY, endX, endY: Integer): BOOL; stdcall;
TFun_Pie = function(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
TFun_PolyPolygon = function(DC: HDC; var Points; var nPoints; p4: Integer): BOOL; stdcall;
TFun_ExtTextOutA = function(DC: HDC; X, Y: Integer; Options: Longint;
Rect: PRect; Str: LPCSTR; Count: Longint; Dx: PInteger): BOOL; stdcall;
TFun_ExtTextOutW = function(DC: HDC; X, Y: Integer; Options: Longint;
Rect: PRect; Str: LPCWSTR; Count: Longint; Dx: PInteger): BOOL; stdcall;
TFun_DrawTextA = function(hDC: HDC; lpString: LPCSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
TFun_DrawTextW = function(hDC: HDC; lpString: LPCWSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
TFun_DrawTextExA = function(DC: HDC; lpchText: LPCSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
TFun_DrawTextExW = function(DC: HDC; lpchText: LPCWSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
TFun_TextOutA = function(DC: HDC; X, Y: Integer; Str: LPCSTR; Count: Integer): BOOL; stdcall;
TFun_TextOutW = function(DC: HDC; X, Y: Integer; Str: LPCWSTR; Count: Integer): BOOL; stdcall;
TFun_PolyTextOutA = function(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
TFun_PolyTextOutW = function(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
TFun_TabbedTextOutA = function(hDC: HDC; X, Y: Integer; lpString: LPCSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
TFun_TabbedTextOutW = function(hDC: HDC; X, Y: Integer; lpString: LPCWSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
function BitBltHook(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC;
XSrc, YSrc: Integer; Rop: DWORD): BOOL; stdcall;
function StretchBltHook(DestDC: HDC; X, Y, SrcWidth, SrcHeight: Integer; SrcDC: HDC;
XSrc, YSrc, DestWidth, DestHeight: Integer; Rop: DWORD): BOOL; stdcall;
function TransparentBltHook(DestDC: HDC; X, Y, DestWidth, DestHeight: Integer; SrcDC: HDC;
XSrc, YSrc, SrcWidth, SrcHeight: Integer; dwTransparent: DWORD): BOOL; stdcall;
function StretchDIBitsHook(DC: HDC; DestX, DestY, DestWidth, DestHeight, SrcX,
SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo;
Usage: UINT; Rop: DWORD): Integer; stdcall;
function SetDIBitsToDeviceHook(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD;
SrcX, SrcY: Integer; nStartScan, NumScans: UINT; Bits: Pointer;
var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
function SetDIBitsHook(DC: HDC; Bitmap: HBITMAP; StartScan, NumScans: UINT;
Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
function SetROP2Hook(DC: HDC; p2: Integer): Integer; stdcall;
function SetMapperFlagsHook(DC: HDC; Flag: DWORD): DWORD; stdcall;
function SetMapModeHook(DC: HDC; p2: Integer): Integer; stdcall;
function SetWindowOrgExHook(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
function SetWorldTransformHook(DC: HDC; const p2: PXForm): BOOL; stdcall;
function SetGraphicsModeHook(hdc: HDC; iMode: Integer): Integer; stdcall;
function ModifyWorldTransformHook(DC: HDC; const p2: PXForm; p3: DWORD): BOOL; stdcall;
function SelectPaletteHook(DC: HDC; Palette: HPALETTE; ForceBackground: Bool): HPALETTE; stdcall;
function SetBkColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
function SetBrushOrgExHook(DC: HDC; X, Y: Integer; PrevPt: PPoint): BOOL; stdcall;
function ExcludeClipRectHook(DC: HDC; LeftRect, TopRect, RightRect, BottomRect: Integer): Integer; stdcall;
function SetTextColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
function CreateHalftonePaletteHook(DC: HDC): HPALETTE; stdcall;
function CreateDIBSectionHook(DC: HDC; const p2: TBitmapInfo; p3: UINT;
var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall;
function SetBoundsRectHook(DC: HDC; p2: PRect; p3: UINT): UINT; stdcall;
function SetSystemPaletteUseHook(DC: HDC; p2: UINT): UINT; stdcall;
function GetTextCharsetInfoHook(hdc: HDC; lpSig: PFontSignature; dwFlags: DWORD): Integer; stdcall;
function RealizePaletteHook(DC: HDC): UINT; stdcall;
function GetGlyphIndicesAHook(DC: HDC; p2: LPCSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
function GetGlyphIndicesWHook(DC: HDC; p2: LPCWSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
function GetFontLanguageInfoHook(DC: HDC): DWORD; stdcall;
function GetCharacterPlacementAHook(DC: HDC; p2: LPCSTR; p3, p4: Integer;
var p5: TGCPResultsA; p6: DWORD): DWORD; stdcall;
function GetCharacterPlacementWHook(DC: HDC; p2: LPCWSTR; p3, p4: Integer;
var p5: TGCPResultsW; p6: DWORD): DWORD; stdcall;
function GetFontDataHook(DC: HDC; p2, p3: DWORD; p4: Pointer; p5: DWORD): DWORD; stdcall;
function GetGlyphOutlineAHook(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
function GetGlyphOutlineWHook(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
function ResetDCAHook(DC: HDC; const InitData: TDeviceModeA): HDC; stdcall;
function ResetDCWHook(DC: HDC; const InitData: TDeviceModeW): HDC; stdcall;
function ColorCorrectPaletteHook(DC: HDC; p2: HPALETTE; p3, p4: DWORD): BOOL; stdcall;
function SetICMProfileAHook(DC: HDC; Name: LPSTR): BOOL; stdcall;
function SetICMProfileWHook(DC: HDC; Name: LPWSTR): BOOL; stdcall;
function AlphaBlendHook(DC: HDC; p2, p3, p4, p5: Integer; DC6: HDC; p7, p8, p9, p10: Integer; p11: TBlendFunction): BOOL; stdcall;
function SetTextJustificationHook(DC: HDC; BreakExtra, BreakCount: Integer): Integer; stdcall;
function ScaleWindowExtExHook(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
function SetMiterLimitHook(DC: HDC; NewLimit: Single; OldLimit: PSingle): BOOL; stdcall;
function CloseFigureHook(DC: HDC): BOOL; stdcall;
function SelectClipPathHook(DC: HDC; Mode: Integer): BOOL; stdcall;
function AbortPathHook(DC: HDC): BOOL; stdcall;
function FrameRgnHook(DC: HDC; hrgn: HRGN; hbr: HBRUSH; Width, Height: Integer): BOOL; stdcall;
function InvertRgnHook(DC: HDC; p2: HRGN): BOOL; stdcall;
function MaskBltHook(DestDC: HDC; XDest, YDest, Width, Height: Integer; SrcDC: HDC;
XScr, YScr: Integer; Mask: HBITMAP; xMask, yMask: Integer; Rop: DWORD): BOOL; stdcall;
function GetTextMetricsAHook(DC: HDC; var TM: TTextMetricA): BOOL; stdcall;
function GetTextMetricsWHook(DC: HDC; var TM: TTextMetricW): BOOL; stdcall;
function GetTextExtentPoint32AHook(DC: HDC; Str: LPCSTR; Count: Integer; var Size: TSize): BOOL; overload; stdcall;
function GetTextExtentPoint32WHook(DC: HDC; Str: LPCWSTR; Count: Integer; var Size: TSize): BOOL; overload; stdcall;
function GdiCommentHook(DC: HDC; p2: UINT; p3: LPSTR): BOOL; stdcall;
function GetCharABCWidthsAHook(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
function GetCharABCWidthsWHook(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
function UpdateColorsHook(DC: HDC): BOOL; stdcall;
function OffsetViewportOrgExHook(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
function OffsetWindowOrgExHook(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
function SetDeviceGammaRampHook(DC: HDC; var Ramp): BOOL; stdcall;
function ColorMatchToTargetHook(DC: HDC; Target: HDC; Action: DWORD): BOOL; stdcall;
function PtVisibleHook(DC: HDC; X, Y: Integer): BOOL; stdcall;
function RectVisibleHook(DC: HDC; const Rect: TRect): BOOL; stdcall;
function SetPixelFormatHook(DC: HDC; PixelFormat: Integer; FormatDef: PPixelFormatDescriptor): BOOL; stdcall;
function SetStretchBltModeHook(DC: HDC; StretchMode: Integer): Integer; stdcall;
function OffsetClipRgnHook(DC: HDC; XOffset, YOffset: Integer): Integer; stdcall;
function IntersectClipRectHook(DC: HDC; X1, Y1, X2, Y2: Integer): Integer; stdcall;
function SetTextCharacterExtraHook(DC: HDC; CharExtra: Integer): Integer; stdcall;
function EnumICMProfilesAHook(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
function EnumICMProfilesWHook(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
function ExtEscapeHook(DC: HDC; p2, p3: Integer; const p4: LPCSTR; p5: Integer; p6: LPSTR): Integer; stdcall;
function EnumFontsAHook(DC: HDC; lpszFace: LPCSTR; fntenmprc: TFNFontEnumProcA; lParam: LPARAM): Integer; stdcall;
function EnumFontsWHook(DC: HDC; lpszFace: LPCWSTR; fntenmprc: TFNFontEnumProcW; lParam: LPARAM): Integer; stdcall;
function EnumFontFamiliesAHook(DC: HDC; p2: LPCSTR; p3: TFNFontEnumProcA; p4: LPARAM): Integer; stdcall;
function EnumFontFamiliesWHook(DC: HDC; p2: LPCWSTR; p3: TFNFontEnumProcW; p4: LPARAM): Integer; stdcall;
function CreateCompatibleDCHook(DC: HDC): HDC; stdcall;
function CreateCompatibleBitmapHook(DC: HDC; Width, Height: Integer): HBITMAP; stdcall;
function SetMetaRgnHook(DC: HDC): Integer; stdcall;
function PlayEnhMetaFileHook(DC: HDC; p2: HENHMETAFILE; const p3: TRect): BOOL; stdcall;
function PlayEnhMetaFileRecordHook(DC: HDC; var p2: THandleTable; const p3: TEnhMetaRecord; p4: UINT): BOOL; stdcall;
function SetPixelHook(DC: HDC; X, Y: Integer; Color: COLORREF): COLORREF; stdcall;
function SetPixelVHook(DC: HDC; X, Y: Integer; Color: COLORREF): BOOL; stdcall;
function LineToHook(DC: HDC; X, Y: Integer): BOOL; stdcall;
function PlgBltHook(DestDC: HDC; const PointsArray; SrcDC: HDC;
XSrc, YSrc, Width, Height: Integer; Mask: HBITMAP; xMask, yMask: Integer): BOOL; stdcall;
function PatBltHook(DC: HDC; X, Y, Width, Height: Integer; Rop: DWORD): BOOL; stdcall;
function MoveToExHook(DC: HDC; p2, p3: Integer; p4: PPoint): BOOL; stdcall;
function PolyBezierToHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
function PolyLineToHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
function PolyDrawHook(DC: HDC; const Points, Types; cCount: Integer): BOOL; stdcall;
function PolygonHook(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
function PolylineHook(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
function PolyBezierHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
function RectangleHook(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
function RoundRectHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3: Integer): BOOL; stdcall;
function BeginPathHook(DC: HDC): BOOL; stdcall;
function EndPathHook(DC: HDC): BOOL; stdcall;
function FillPathHook(DC: HDC): BOOL; stdcall;
function FlattenPathHook(DC: HDC): BOOL; stdcall;
function WidenPathHook(DC: HDC): BOOL; stdcall;
function StrokePathHook(DC: HDC): BOOL; stdcall;
function StrokeAndFillPathHook(DC: HDC): BOOL; stdcall;
function SetDCBrushColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
function SetDCPenColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
function SetDIBColorTableHook(DC: HDC; p2, p3: UINT; var RGBQuadSTructs): UINT; stdcall;
function SetTextAlignHook(DC: HDC; Flags: UINT): UINT; stdcall;
function SetBkModeHook(DC: HDC; BkMode: Integer): Integer; stdcall;
function GradientFillHook(DC: HDC; Vertex: PTriVertex; NumVertex: ULONG; Mesh: Pointer; NumMesh, Mode: ULONG): BOOL; stdcall;
function FillRectHook(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
function FrameRectHook(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
function ExtFloodFillHook(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
function FloodFillHook(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
function FillRgnHook(DC: HDC; hrgn: HRGN; hbr: HBRUSH): BOOL; stdcall;
function SetPolyFillModeHook(DC: HDC; PolyFillMode: Integer): Integer; stdcall;
function DrawEscapeHook(DC: HDC; p2, p3: Integer; p4: LPCSTR): BOOL; stdcall;
function PaintRgnHook(DC: HDC; RGN: HRGN): BOOL; stdcall;
function SetColorAdjustmentHook(DC: HDC; const p2: TColorAdjustment): BOOL; stdcall;
function SetArcDirectionHook(DC: HDC; Direction: Integer): Integer; stdcall;
function SetViewportExtExHook(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
function SetViewportOrgExHook(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
function ScaleViewportExtExHook(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
function SetWindowExtExHook(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
function SelectClipRgnHook(DC: HDC; Region: HRGN): Integer; stdcall;
function ExtSelectClipRgnHook(DC: HDC; Region: HRGN; Mode: Integer): Integer; stdcall;
function SetICMModeHook(DC: HDC; Mode: Integer): Integer; stdcall;
function SetColorSpaceHook(DC: HDC; ColorSpace: HCOLORSPACE): BOOL; stdcall;
function SaveDCHook(DC: HDC): Integer; stdcall;
function RestoreDCHook(DC: HDC; SavedDC: Integer): BOOL; stdcall;
function AngleArcHook(DC: HDC; p2, p3: Integer; p4: DWORD; p5, p6: Single): BOOL; stdcall;
function ArcToHook(DC: HDC; RLeft, RTop, RRight, RBottom: Integer; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
function PolyPolylineHook(DC: HDC; const PointStructs; const Points; p4: DWORD): BOOL; stdcall;
function EllipseHook(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
function LPtoDPHook(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall;
function DPtoLPHook(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall;
function SelectObjectHook(DC: HDC; p2: HGDIOBJ): HGDIOBJ; stdcall;
function ChordHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
function ArcHook(hDC: HDC; left, top, right, bottom, startX, startY, endX, endY: Integer): BOOL; stdcall;
function PieHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
function PolyPolygonHook(DC: HDC; var Points; var nPoints; p4: Integer): BOOL; stdcall;
function ExtTextOutAHook(DC: HDC; X, Y: Integer; Options: Longint;
const Rect: PRect; Str: LPCSTR; Count: Longint; const Dx: PInteger): BOOL; stdcall;
function ExtTextOutWHook(DC: HDC; X, Y: Integer; Options: Longint;
const Rect: PRect; Str: LPCWSTR; Count: Longint; const Dx: PInteger): BOOL; stdcall;
function DrawTextAHook(hDC: HDC; lpString: LPCSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
function DrawTextWHook(hDC: HDC; lpString: LPCWSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
function DrawTextExAHook(DC: HDC; lpchText: LPCSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
function DrawTextExWHook(DC: HDC; lpchText: LPCWSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
function TextOutAHook(DC: HDC; X, Y: Integer; Str: LPCSTR; Count: Integer): BOOL; stdcall;
function TextOutWHook(DC: HDC; X, Y: Integer; Str: LPCWSTR; Count: Integer): BOOL; stdcall;
function PolyTextOutAHook(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
function PolyTextOutWHook(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
function TabbedTextOutAHook(hDC: HDC; X, Y: Integer; lpString: LPCSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
function TabbedTextOutWHook(hDC: HDC; X, Y: Integer; lpString: LPCWSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
function CreateCopyDC(aPrtDC: HDC; sDocName: String; nPageIdx: Integer): HDC;
procedure DeleteCopyDC;
var
ozBitBlt: TFun_BitBlt = nil;
ozStretchBlt: TFun_StretchBlt = nil;
ozTransparentBlt: TFun_TransparentBlt = nil;
ozStretchDIBits: TFun_StretchDIBits = nil;
ozSetDIBitsToDevice: TFun_SetDIBitsToDevice = nil;
ozSetDIBits: TFun_SetDIBits = nil;
ozSetROP2: TFun_SetROP2 = nil;
ozSetMapperFlags: TFun_SetMapperFlags = nil;
ozSetGraphicsMode: TFun_SetGraphicsMode = nil;
ozSetMapMode: TFun_SetMapMode = nil;
ozSetWindowOrgEx: TFun_SetWindowOrgEx = nil;
ozModifyWorldTransform: TFun_ModifyWorldTransform = nil;
ozSelectPalette: TFun_SelectPalette = nil;
ozSetBkColor: TFun_SetBkColor = nil;
ozSetBrushOrgEx: TFun_SetBrushOrgEx = nil;
ozSetWorldTransform: TFun_SetWorldTransform = nil;
ozExcludeClipRect: TFun_ExcludeClipRect = nil;
ozSetTextColor: TFun_SetTextColor = nil;
ozCreateHalftonePalette: TFun_CreateHalftonePalette = nil;
ozCreateDIBSection: TFun_CreateDIBSection = nil;
ozSetBoundsRect: TFun_SetBoundsRect = nil;
ozSetSystemPaletteUse: TFun_SetSystemPaletteUse = nil;
ozGetTextCharsetInfo: TFun_GetTextCharsetInfo = nil;
ozRealizePalette: TFun_RealizePalette = nil;
ozGetGlyphIndicesA: TFun_GetGlyphIndicesA = nil;
ozGetGlyphIndicesW: TFun_GetGlyphIndicesW = nil;
ozGetFontLanguageInfo: TFun_GetFontLanguageInfo = nil;
ozGetCharacterPlacementA: TFun_GetCharacterPlacementA = nil;
ozGetCharacterPlacementW: TFun_GetCharacterPlacementW = nil;
ozGetFontData: TFun_GetFontData = nil;
ozGetGlyphOutlineA: TFun_GetGlyphOutlineA = nil;
ozGetGlyphOutlineW: TFun_GetGlyphOutlineW = nil;
ozResetDCA: TFun_ResetDCA = nil;
ozResetDCW: TFun_ResetDCW = nil;
ozColorCorrectPalette: TFun_ColorCorrectPalette = nil;
ozSetICMProfileA: TFun_SetICMProfileA = nil;
ozSetICMProfileW: TFun_SetICMProfileW = nil;
ozAlphaBlend: TFun_AlphaBlend = nil;
ozSetTextJustification: TFun_SetTextJustification = nil;
ozScaleWindowExtEx: TFun_ScaleWindowExtEx = nil;
ozRestoreDC: TFun_RestoreDC = nil;
ozSetMiterLimit: TFun_SetMiterLimit = nil;
ozCloseFigure: TFun_CloseFigure = nil;
ozSelectClipPath: TFun_SelectClipPath = nil;
ozAbortPath: TFun_AbortPath = nil;
ozFrameRgn: TFun_FrameRgn = nil;
ozInvertRgn: TFun_InvertRgn = nil;
ozMaskBlt: TFun_MaskBlt = nil;
ozGetTextMetricsA: TFun_GetTextMetricsA = nil;
ozGetTextMetricsW: TFun_GetTextMetricsW = nil;
ozGetTextExtentPoint32A: TFun_GetTextExtentPoint32A = nil;
ozGetTextExtentPoint32W: TFun_GetTextExtentPoint32W = nil;
ozGdiComment: TFun_GdiComment = nil;
ozGetCharABCWidthsA: TFun_GetCharABCWidthsA = nil;
ozGetCharABCWidthsW: TFun_GetCharABCWidthsW = nil;
ozUpdateColors: TFun_UpdateColors = nil;
ozOffsetViewportOrgEx: TFun_OffsetViewportOrgEx = nil;
ozOffsetWindowOrgEx: TFun_OffsetWindowOrgEx = nil;
ozOffsetWindowOrgEx2: TFun_OffsetWindowOrgEx2 = nil;
ozSetDeviceGammaRamp: TFun_SetDeviceGammaRamp = nil;
ozColorMatchToTarget: TFun_ColorMatchToTarget = nil;
ozPtVisible: TFun_PtVisible = nil;
ozRectVisible: TFun_RectVisible = nil;
ozSetPixelFormat: TFun_SetPixelFormat = nil;
ozSetStretchBltMode: TFun_SetStretchBltMode = nil;
ozOffsetClipRgn: TFun_OffsetClipRgn = nil;
ozIntersectClipRect: TFun_IntersectClipRect = nil;
ozSetTextCharacterExtra: TFun_SetTextCharacterExtra = nil;
ozEnumICMProfilesA: TFun_EnumICMProfilesA = nil;
ozEnumICMProfilesW: TFun_EnumICMProfilesW = nil;
ozExtEscape: TFun_ExtEscape = nil;
ozEnumFontsA: TFun_EnumFontsA = nil;
ozEnumFontsW: TFun_EnumFontsW = nil;
ozEnumFontFamiliesA: TFun_EnumFontFamiliesA = nil;
ozEnumFontFamiliesW: TFun_EnumFontFamiliesW = nil;
ozCreateCompatibleDC: TFun_CreateCompatibleDC = nil;
ozCreateCompatibleBitmap: TFun_CreateCompatibleBitmap = nil;
ozSetMetaRgn: TFun_SetMetaRgn = nil;
ozPlayEnhMetaFile: TFun_PlayEnhMetaFile = nil;
ozPlayEnhMetaFileRecord: TFun_PlayEnhMetaFileRecord = nil;
ozSetPolyFillMode: TFun_SetPolyFillMode = nil;
ozSetPixel: TFun_SetPixel = nil;
ozSetPixelV: TFun_SetPixelV = nil;
ozLineTo: TFun_LineTo = nil;
ozPlgBlt: TFun_PlgBlt = nil;
ozPatBlt: TFun_PatBlt = nil;
ozMoveToEx: TFun_MoveToEx = nil;
ozPolyBezierTo: TFun_PolyBezierTo = nil;
ozPolyLineTo: TFun_PolyLineTo = nil;
ozPolyDraw: TFun_PolyDraw = nil;
ozPolygon: TFun_Polygon = nil;
ozPolyline: TFun_Polyline = nil;
ozPolyBezier: TFun_PolyBezier = nil;
ozRectangle: TFun_Rectangle = nil;
ozRoundRect: TFun_RoundRect = nil;
ozBeginPath: TFun_BeginPath = nil;
ozEndPath: TFun_EndPath = nil;
ozFillPath: TFun_FillPath = nil;
ozFlattenPath: TFun_FlattenPath = nil;
ozWidenPath: TFun_WidenPath = nil;
ozStrokePath: TFun_StrokePath = nil;
ozStrokeAndFillPath: TFun_StrokeAndFillPath = nil;
ozSetDCBrushColor: TFun_SetDCBrushColor = nil;
ozSetDCPenColor: TFun_SetDCPenColor = nil;
ozSetDIBColorTable: TFun_SetDIBColorTable = nil;
ozSetTextAlign: TFun_SetTextAlign = nil;
ozSetBkMode: TFun_SetBkModeHook = nil;
ozGradientFill: TFun_GradientFill = nil;
ozFillRect: TFun_FillRect = nil;
ozFrameRect: TFun_FrameRect = nil;
ozExtFloodFill: TFun_ExtFloodFill = nil;
ozFloodFill: TFun_FloodFill = nil;
ozFillRgn: TFun_FillRgn = nil;
ozDrawEscape: TFun_DrawEscape = nil;
ozPaintRgn: TFun_PaintRgn = nil;
ozSetColorAdjustment: TFun_SetColorAdjustment = nil;
ozSetArcDirection: TFun_SetArcDirection = nil;
ozSetViewportExtEx: TFun_SetViewportExtEx = nil;
ozSetViewportOrgEx: TFun_SetViewportOrgEx = nil;
ozScaleViewportExtEx: TFun_ScaleViewportExtEx = nil;
ozSetWindowExtEx: TFun_SetWindowExtEx = nil;
ozSelectClipRgn: TFun_SelectClipRgn = nil;
ozExtSelectClipRgn: TFun_ExtSelectClipRgn = nil;
ozSetICMMode: TFun_SetICMMode = nil;
ozSetColorSpace: TFun_SetColorSpace = nil;
ozSaveDC: TFun_SaveDC = nil;
ozAngleArc: TFun_AngleArc = nil;
ozArcTo: TFun_ArcTo = nil;
ozPolyPolyline: TFun_PolyPolyline = nil;
ozEllipse: TFun_Ellipse = nil;
ozLPtoDP: TFun_LPtoDP = nil;
ozDPtoLP: TFun_DPtoLP = nil;
ozSelectObject: TFun_SelectObject = nil;
ozChord: TFun_Chord = nil;
ozArc: TFun_Arc = nil;
ozPie: TFun_Pie = nil;
ozPolyPolygon: TFun_PolyPolygon = nil;
ozExtTextOutA: TFun_ExtTextOutA = nil;
ozExtTextOutW: TFun_ExtTextOutW = nil;
ozDrawTextA: TFun_DrawTextA = nil;
ozDrawTextW: TFun_DrawTextW = nil;
ozDrawTextExA: TFun_DrawTextExA = nil;
ozDrawTextExW: TFun_DrawTextExW = nil;
ozTextOutA: TFun_TextOutA = nil;
ozTextOutW: TFun_TextOutW = nil;
ozPolyTextOutA: TFun_PolyTextOutA = nil;
ozPolyTextOutW: TFun_PolyTextOutW = nil;
ozTabbedTextOutA: TFun_TabbedTextOutA = nil;
ozTabbedTextOutW: TFun_TabbedTextOutW = nil;
// 출력물 수집을 위한 DC 25_0930 16:47:27 kku
_CopyDC: HDC = 0;
_PrtDC: HDC = 0;
_hNotepadFont: HFONT = 0;
_OldNotepadFont: HFONT = 0;
_sEmfPath: String = '';
_nTmp: Integer = 0;
_bSkipNextMWT: Boolean = false;
implementation
uses
{$IFDEF _BS1HP_}
BS1Hook,
{$ELSE}
AppHook,
{$ENDIF}
Tocsg.Strings, Vcl.Imaging.pngimage, ApiHookPrint, AppCtrlDefine;
function CreateCopyDC(aPrtDC: HDC; sDocName: String; nPageIdx: Integer): HDC;
var
DC: HDC;
nPhyicalW, nPhyicalH,
nDevWmm, nDevHmm, nDevX, nDevY: Integer;
R: TRect;
hP, hOldP: HPEN;
hB, hOldB: HBRUSH;
OrgFont: TLogFont;
hCurFont: HFONT;
begin
Result := 0;
try
if (gAppHook = nil) or (gAppHook.Helper = nil) then
exit;
if gAppHook.Helper.CtrlOpt.sPrtEmfOutDir = '' then
exit;
if not ForceDirectories(gAppHook.Helper.CtrlOpt.sPrtEmfOutDir) then
exit;
if _CopyDC <> 0 then
DeleteCopyDC;
hP := 0;
hOldP := 0;
hB := 0;
hOldB:= 0;
_nTmp := 0;
_bSkipNextMWT := false;
DC := CreateCompatibleDC(aPrtDC);
// 페이지 전체 픽셀 수(용지 포함)
nPhyicalW := GetDeviceCaps(DC, PHYSICALWIDTH);
nPhyicalH := GetDeviceCaps(DC, PHYSICALHEIGHT);
// 실제 출력 장치(모니터/프린터)의 논리적 해상도 (픽셀 단위)
nDevX := GetDeviceCaps(DC, HORZRES);
nDevY := GetDeviceCaps(DC, VERTRES);
// 출력 장치의 물리적 크기(mm 단위)
nDevWmm := GetDeviceCaps(DC, HORZSIZE);
nDevHmm := GetDeviceCaps(DC, VERTSIZE);
ZeroMemory(@R, SizeOf(R));
// nPhyicalW / nDevX : 한 픽셀이 차지하는 물리적 길이(장치 전체 폭에서 논리 폭으로 환산)
// nDevX * 100 : mm 단위를 0.01mm 단위로 바꿔줌
// 픽셀 기반 값(PHYSICALWIDTH, PHYSICALHEIGHT)을 실제 mm 단위로 변환한 뒤, 다시 0.01mm 단위로 정규화
// R을 "출력 장치의 실제 물리적 크기" 기준(0.01mm 단위) 좌표계로 정의하기 위해 계산
// 픽셀 좌표(nDevX, nDevY)를 그대로 쓰면 장치마다 크기가 달라지지만, 0.01mm 단위로 바꿔두면 장치에 무관하게 동일한 물리적 크기를 표현 가능
R.Right := (nPhyicalW * nDevWmm * 100) div nDevX;
R.Bottom := (nPhyicalH * nDevHmm * 100) div nDevY;
gAppHook.Log('CreateCopyDC() .. W=%d, H=%d, DX=%d, DY=%d, PW=%d, PH=%d',
[R.Right, R.Bottom, nDevX, nDevY, nPhyicalW, nPhyicalH]);
_sEmfPath := gAppHook.Helper.CtrlOpt.sPrtEmfOutDir + Format('%s-%.4d.em1', [sDocName, nPageIdx]); // 파수 DRM이 emf를 자동 암호화해버려서 em1로 변경 25_1111 09:09:58 kku
// _CopyDC := CreateEnhMetaFile(DC, PChar(_sEmfPath), nil, 'BS1 Preview File');
_CopyDC := CreateEnhMetaFile(DC, nil, nil, 'BS1 Preview File'); // 파일로 한번에 저장하는 방식으로 변경 25_1013 14:38:04 kku
if _CopyDC <> 0 then
begin
_PrtDC := aPrtDC;
Result := _CopyDC;
DeleteDC(DC);
hP := CreatePen(PS_SOLID, 1, RGB(255, 255, 255));
hOldP := SelectObject(_CopyDC, hP);
hB := GetStockObject(WHITE_BRUSH);
hOldB := SelectObject(_CopyDC, hB);
Rectangle(_CopyDC, 0, 0, nDevX, nDevY);
SelectObject(_CopyDC, hOldP);
SelectObject(_CopyDC, hOldB);
if CompareText(gAppHook.Helper.AppName, 'notepad.exe') = 0 then
begin
gAppHook.Log('CreateCopyDC() .. Notepad Font change');
ZeroMemory(@OrgFont, SizeOf(OrgFont));
hCurFont := GetCurrentObject(aPrtDC, OBJ_FONT);
if hCurFont <> 0 then
begin
GetObject(hCurFont, SizeOf(LOGFONTW), @OrgFont);
gAppHook.Log('CreateCopyDC() .. Notepad OrgFont .. IfFaceName=%s, IfHeight=%d', [OrgFont.lfFaceName, OrgFont.lfHeight]);
_hNotepadFont := CreateFontIndirect(OrgFont);
if _hNotepadFont <> 0 then
_OldNotepadFont := SelectObject(_CopyDC, _hNotepadFont);
end;
end;
if hP <> 0 then
DeleteObject(hP);
gAppHook.Log('CreateCopyDC() .. OK')
end else begin
gAppHook.Log('CreateCopyDC() .. Fail .. CreateEnhMetaFile()');
end;
except
// on E: Exception do
// ETgException.TraceException(Self, E, 'Fail .. CreateMemDC()');
end;
end;
procedure EmfToPng(const sEmfPath, sPngPath: string;
TargetDPI: Integer = 96; Background: TColor = clWhite);
var
mf: TMetafile;
bmp: TBitmap;
png: TPngImage;
nW, nH: Integer;
begin
mf := TMetafile.Create;
try
mf.LoadFromFile(sEmfPath);
// TMetafile.MMWidth/MMHeight는 0.01mm 단위
if (mf.MMWidth = 0) or (mf.MMHeight = 0) then
raise Exception.Create('유효하지 않은 EMF 크기입니다.');
nW := MulDiv(mf.MMWidth, TargetDPI, 2540); // 2540 = 25.4(mm) * 100
nH := MulDiv(mf.MMHeight, TargetDPI, 2540);
bmp := TBitmap.Create;
try
bmp.SetSize(nW, nH);
bmp.PixelFormat := pf24bit;
bmp.Canvas.Brush.Color := Background;
bmp.Canvas.FillRect(Rect(0, 0, nW, nH));
// 간단히 벡터를 래스터로 그려 넣기
bmp.Canvas.StretchDraw(Rect(0, 0, nW, nH), mf);
png := TPngImage.Create;
try
png.Assign(bmp);
png.SaveToFile(sPngPath);
finally
png.Free;
end;
finally
bmp.Free;
end;
finally
mf.Free;
end;
end;
procedure DeleteCopyDC;
var
hEmf, hEmfCopy: HENHMETAFILE;
i: Integer;
begin
if _CopyDC = 0 then
exit;
hEmf := CloseEnhMetaFile(_CopyDC);
hEmfCopy := CopyEnhMetaFile(hEmf, PChar(_sEmfPath)); // 파일로 한번에 저장하는 방식으로 변경 25_1013 14:38:04 kku
if hEmfCopy <> 0 then
DeleteEnhMetaFile(hEmfCopy);
if hEmf <> 0 then
begin
DeleteEnhMetaFile(hEmf);
if FileExists(_sEmfPath) then
begin
{$IFNDEF _BS1HP_}
try
EmfToPng(_sEmfPath, _sEmfPath + '.png', 600, clWhite);
except
end;
{$ENDIF}
_sEmfPath := '';
end;
end else
gAppHook.Log('DeleteMemDC() .. Fail Error=%d', [GetLastError]);
if _hNotepadFont <> 0 then
begin
DeleteObject(_hNotepadFont);
_hNotepadFont := 0;
end;
DeleteDC(_CopyDC);
_CopyDC := 0;
_PrtDC := 0;
// GdiFlush;
end;
function IsAblePrintDrawCopy(aPrtDC: HDC): Boolean;
begin
Result := (_CopyDC <> 0) and (_PrtDC = aPrtDC) and not gPrtWatering;
end;
function BitBltHook(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC;
XSrc, YSrc: Integer; Rop: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DestDC) then
begin
// gAppHook.Log(Format('BitBltHook() .. X=%d, Y=%d, Width=%d, Height=%d', [X, Y, Width, Height]));
try
ozBitBlt(_CopyDC, X, Y, Width, Height, SrcDC, XSrc, YSrc, Rop);
except
on E: Exception do
gAppHook.Log('Fail .. BitBltHook() .. ' + E.Message);
end;
end;
Result := ozBitBlt(DestDC, X, Y, Width, Height, SrcDC, XSrc, YSrc, Rop);
end;
function StretchBltHook(DestDC: HDC; X, Y, SrcWidth, SrcHeight: Integer; SrcDC: HDC;
XSrc, YSrc, DestWidth, DestHeight: Integer; Rop: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DestDC) then
begin
// gAppHook.Log(Format('StretchBltHook() .. XSrc=%d, YSrc=%d, SrcWidth=%d, SrcHeight=%d', [XSrc, YSrc, SrcWidth, SrcHeight]));
try
ozStretchBlt(_CopyDC, X, Y, SrcWidth, SrcHeight, SrcDC, XSrc, YSrc, DestWidth, DestHeight, Rop);
except
on E: Exception do
gAppHook.Log('Fail .. StretchBltHook() .. ' + E.Message);
end;
end;
Result := ozStretchBlt(DestDC, X, Y, SrcWidth, SrcHeight, SrcDC, XSrc, YSrc, DestWidth, DestHeight, Rop);
end;
function TransparentBltHook(DestDC: HDC; X, Y, DestWidth, DestHeight: Integer; SrcDC: HDC;
XSrc, YSrc, SrcWidth, SrcHeight: Integer; dwTransparent: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DestDC) then
begin
// gAppHook.Log(Format('TransparentBltHook() .. XSrc=%d, YSrc=%d, SrcWidth=%d, SrcHeight=%d', [XSrc, YSrc, SrcWidth, SrcHeight]));
try
ozTransparentBlt(_CopyDC, X, Y, DestWidth, DestHeight, SrcDC, XSrc, YSrc, SrcWidth, SrcHeight, dwTransparent);
except
on E: Exception do
gAppHook.Log('Fail .. TransparentBltHook() .. ' + E.Message);
end;
end;
Result := ozTransparentBlt(DestDc, X, Y, DestWidth, DestHeight, SrcDC, XSrc, YSrc, SrcWidth, SrcHeight, dwTransparent);
end;
function StretchDIBitsHook(DC: HDC; DestX, DestY, DestWidth, DestHeight, SrcX,
SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo;
Usage: UINT; Rop: DWORD): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
try
ozStretchDIBits(_CopyDC, DestX, DestY, DestWidth, DestHeight, SrcX, SrcY,
SrcWidth, SrcHeight, Bits, BitsInfo, Usage, Rop);
except
on E: Exception do
gAppHook.Log('Fail .. StretchDIBitsHook() .. ' + E.Message);
end;
end;
Result := ozStretchDIBits(DC, DestX, DestY, DestWidth, DestHeight, SrcX, SrcY,
SrcWidth, SrcHeight, Bits, BitsInfo, Usage, Rop);
end;
function SetDIBitsToDeviceHook(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD;
SrcX, SrcY: Integer; nStartScan, NumScans: UINT; Bits: Pointer;
var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
// gAppHook.Log(Format('SetDIBitsToDeviceHook() .. DestX=%d, DestY=%d, Width=%d, Height=%d', [DestX, DestY, Width, Height]));
try
ozSetDIBitsToDevice(_CopyDC, DestX, DestY, Width, Height, SrcX, SrcY, nStartScan, NumScans, Bits, BitsInfo, Usage);
except
on E: Exception do
gAppHook.Log('Fail .. SetDIBitsToDeviceHook() .. ' + E.Message);
end;
end;
Result := ozSetDIBitsToDevice(DC, DestX, DestY, Width, Height, SrcX, SrcY, nStartScan, NumScans, Bits, BitsInfo, Usage);
end;
function SetDIBitsHook(DC: HDC; Bitmap: HBITMAP; StartScan, NumScans: UINT;
Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetDIBits(_CopyDC, Bitmap, StartScan, NumScans, Bits, BitsInfo, Usage);
Result := ozSetDIBits(DC, Bitmap, StartScan, NumScans, Bits, BitsInfo, Usage);
end;
function SetROP2Hook(DC: HDC; p2: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetROP2(_CopyDC, p2);
Result := ozSetROP2(DC, p2);
end;
function SetMapperFlagsHook(DC: HDC; Flag: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetMapperFlags(_CopyDC, Flag);
Result := ozSetMapperFlags(DC, Flag);
end;
function SetMapModeHook(DC: HDC; p2: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetMapMode(_CopyDC, p2);
Result := ozSetMapMode(DC, p2);
end;
function SetWindowOrgExHook(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetWindowOrgEx(_CopyDC, X, Y, Point);
Result := ozSetWindowOrgEx(DC, X, Y, Point);
end;
procedure SetFromMetrix(aDC: HDC; aXForm: PXForm); stdcall;
begin
if aXForm <> nil then
begin
// _xFormX := Round(aXForm.eDx);
// _xFormY := Round(aXForm.eDy);
end;
end;
function SetWorldTransformHook(DC: HDC; const p2: PXForm): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetWorldTransform(_CopyDC, p2);
Result := ozSetWorldTransform(DC, p2);
// if Result then
// begin
// if IsAblePrintDrawCopy(DC) then
// begin
// var W: TXForm;
// GetWorldTransform(DC, W);
// ozSetWorldTransform(_CopyDC, @W);
// _bSkipNextMWT := true;
// end;
// OFFICE군중 ExtTexout의 Y좌표값이 라인이 변경되어도 고정값으로 들어오는 경우가
// 존재하여, _ModifyWorldTransform, SetWorldTransform 에서 XFORM의 Y좌표값을 저장
// SetFromMetrix(DC, p2);
// end;
end;
function SetGraphicsModeHook(hdc: HDC; iMode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(hDC) then
ozSetGraphicsMode(_CopyDC, iMode);
Result := ozSetGraphicsMode(hdc, iMode);
end;
function MatAlmostEqual(const A, B: XFORM; Eps: Single = 1e-5): Boolean;
begin
Result :=
(Abs(A.eM11 - B.eM11) < Eps) and
(Abs(A.eM12 - B.eM12) < Eps) and
(Abs(A.eM21 - B.eM21) < Eps) and
(Abs(A.eM22 - B.eM22) < Eps) and
(Abs(A.eDx - B.eDx ) < Eps) and
(Abs(A.eDy - B.eDy ) < Eps);
end;
function ModifyWorldTransformHook(DC: HDC; const p2: PXForm; p3: DWORD): BOOL; stdcall;
begin
// if IsAblePrintDrawCopy(DC) then
// ozModifyWorldTransform(_CopyDC, p2, p3);
Result := ozModifyWorldTransform(DC, p2, p3);
if Result and IsAblePrintDrawCopy(DC) then
begin
if gAppHook.Helper.CurAppType = catPPT then
begin
// 그냥 위 처럼 처리하면 좌표 이동이 두번 누적되는 경우가 발생한다... (원인 파악은 실패...)
// 아래처럼 원본과 좌표를 비교해서 강제로 맞춰주도록 보완
// 현재는 파워 포인트에서만 확인됨 25_1010 16:16:33 kku
var W0, W1: TXForm;
GetWorldTransform(DC, W0);
GetWorldTransform(_CopyDC, W1);
if not MatAlmostEqual(W0, W1) then
ozModifyWorldTransform(_CopyDC, @W0, p3);
end else
ozModifyWorldTransform(_CopyDC, p2, p3);
end;
// if Result then
// SetFromMetrix(DC, p2);
end;
function SelectPaletteHook(DC: HDC; Palette: HPALETTE; ForceBackground: Bool): HPALETTE; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSelectPalette(_CopyDC, Palette, ForceBackground);
Result := ozSelectPalette(DC, Palette, ForceBackground);
end;
function SetBkColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetBkColor(_CopyDC, Color);
Result := ozSetBkColor(DC, Color);
end;
function SetBrushOrgExHook(DC: HDC; X, Y: Integer; PrevPt: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetBrushOrgEx(_CopyDC, X, Y, PrevPt);
Result := ozSetBrushOrgEx(DC, X, Y, PrevPt);
end;
function ExcludeClipRectHook(DC: HDC; LeftRect, TopRect, RightRect, BottomRect: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozExcludeClipRect(_CopyDC, LeftRect, TopRect, RightRect, BottomRect);
Result := ozExcludeClipRect(DC, LeftRect, TopRect, RightRect, BottomRect);
end;
function SetTextColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetTextColor(_CopyDC, Color);
Result := ozSetTextColor(DC, Color);
end;
function CreateHalftonePaletteHook(DC: HDC): HPALETTE; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozCreateHalftonePalette(_CopyDC);
Result := ozCreateHalftonePalette(DC);
end;
function CreateDIBSectionHook(DC: HDC; const p2: TBitmapInfo; p3: UINT;
var p4: Pointer; p5: THandle; p6: DWORD): HBITMAP; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozCreateDIBSection(_CopyDC, p2, p3, p4, p5, p6);
Result := ozCreateDIBSection(DC, p2, p3, p4, p5, p6);
end;
function SetBoundsRectHook(DC: HDC; p2: PRect; p3: UINT): UINT; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetBoundsRect(_CopyDC, p2, p3);
Result := ozSetBoundsRect(Dc, p2, p3);
end;
function SetSystemPaletteUseHook(DC: HDC; p2: UINT): UINT; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetSystemPaletteUse(_CopyDC, p2);
Result := ozSetSystemPaletteUse(DC, p2);
end;
function GetTextCharsetInfoHook(hdc: HDC; lpSig: PFontSignature; dwFlags: DWORD): Integer; stdcall;
begin
if IsAblePrintDrawCopy(hDC) then
ozGetTextCharsetInfo(_CopyDC, lpSig, dwFlags);
Result := ozGetTextCharsetInfo(hdc, lpSig, dwFlags);
end;
function RealizePaletteHook(DC: HDC): UINT; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozRealizePalette(_CopyDC);
Result := ozRealizePalette(DC);
end;
function GetGlyphIndicesAHook(DC: HDC; p2: LPCSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetGlyphIndicesA(_CopyDC, p2, p3, p4, p5);
Result := ozGetGlyphIndicesA(DC, p2, p3, p4, p5);
end;
function GetGlyphIndicesWHook(DC: HDC; p2: LPCWSTR; p3: Integer; p4: PWORD; p5: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetGlyphIndicesW(_CopyDC, p2, p3, p4, p5);;
Result := ozGetGlyphIndicesW(DC, p2, p3, p4, p5);;
end;
function GetFontLanguageInfoHook(DC: HDC): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetFontLanguageInfo(_CopyDC);
Result := ozGetFontLanguageInfo(DC);
end;
function GetCharacterPlacementAHook(DC: HDC; p2: LPCSTR; p3, p4: Integer;
var p5: TGCPResultsA; p6: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetCharacterPlacementA(_CopyDC, p2, p3, p4, p5, p6);
Result := ozGetCharacterPlacementA(DC, p2, p3, p4, p5, p6);
end;
function GetCharacterPlacementWHook(DC: HDC; p2: LPCWSTR; p3, p4: Integer;
var p5: TGCPResultsW; p6: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetCharacterPlacementW(_CopyDC, p2, p3, p4, p5, p6);
Result := ozGetCharacterPlacementW(DC, p2, p3, p4, p5, p6);
end;
function GetFontDataHook(DC: HDC; p2, p3: DWORD; p4: Pointer; p5: DWORD): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetFontData(_CopyDC, p2, p3, p4, p5);
Result := ozGetFontData(DC, p2, p3, p4, p5);
end;
function GetGlyphOutlineAHook(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetGlyphOutlineA(_CopyDC, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
Result := ozGetGlyphOutlineA(DC, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
end;
function GetGlyphOutlineWHook(DC: HDC; uChar, uFormat: UINT;
const lpgm: TGlyphMetrics; cbBuffer: DWORD; lpvBuffer: Pointer; const lpmat2: TMat2): DWORD; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetGlyphOutlineW(_CopyDC, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
Result := ozGetGlyphOutlineW(DC, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
end;
function ResetDCAHook(DC: HDC; const InitData: TDeviceModeA): HDC; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozResetDCA(_CopyDC, InitData);
Result := ozResetDCA(DC, InitData);
end;
function ResetDCWHook(DC: HDC; const InitData: TDeviceModeW): HDC; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozResetDCW(_CopyDC, InitData);
Result := ozResetDCW(DC, InitData);
end;
function ColorCorrectPaletteHook(DC: HDC; p2: HPALETTE; p3, p4: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozColorCorrectPalette(_CopyDC, p2, p3, p4);
Result := ozColorCorrectPalette(DC, p2, p3, p4);
end;
function SetICMProfileAHook(DC: HDC; Name: LPSTR): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetICMProfileA(_CopyDC, Name);
Result := ozSetICMProfileA(DC, Name);
end;
function SetICMProfileWHook(DC: HDC; Name: LPWSTR): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetICMProfileW(_CopyDC, Name);
Result := ozSetICMProfileW(DC, Name);
end;
function AlphaBlendHook(DC: HDC; p2, p3, p4, p5: Integer; DC6: HDC; p7, p8, p9, p10: Integer; p11: TBlendFunction): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozAlphaBlend(_CopyDC, p2, p3, p4, p5, DC6, p7, p8, p9, p10, p11);
Result := ozAlphaBlend(DC, p2, p3, p4, p5, DC6, p7, p8, p9, p10, p11);
end;
function SetTextJustificationHook(DC: HDC; BreakExtra, BreakCount: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetTextJustification(_CopyDC, BreakExtra, BreakCount);
Result := ozSetTextJustification(DC, BreakExtra, BreakCount);
end;
function ScaleWindowExtExHook(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozScaleWindowExtEx(_CopyDC, XM, XD, YM, YD, Size);
Result := ozScaleWindowExtEx(DC, XM, XD, YM, YD, Size);
end;
function SetMiterLimitHook(DC: HDC; NewLimit: Single; OldLimit: PSingle): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetMiterLimit(_CopyDC, NewLimit, OldLimit);
Result := ozSetMiterLimit(DC, NewLimit, OldLimit);
end;
function CloseFigureHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozCloseFigure(_CopyDC);
Result := ozCloseFigure(DC);
end;
function SelectClipPathHook(DC: HDC; Mode: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSelectClipPath(_CopyDC, Mode);
Result := ozSelectClipPath(DC, Mode);
end;
function AbortPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozAbortPath(_CopyDC);
Result := ozAbortPath(DC);
end;
function FrameRgnHook(DC: HDC; hrgn: HRGN; hbr: HBRUSH; Width, Height: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozFrameRgn(_CopyDC, hrgn, hbr, Width, Height);
Result := ozFrameRgn(DC, hrgn, hbr, Width, Height);
end;
function InvertRgnHook(DC: HDC; p2: HRGN): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozInvertRgn(_CopyDC, p2);
Result := ozInvertRgn(DC, p2);
end;
function MaskBltHook(DestDC: HDC; XDest, YDest, Width, Height: Integer; SrcDC: HDC;
XScr, YScr: Integer; Mask: HBITMAP; xMask, yMask: Integer; Rop: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DestDC) then
ozMaskBlt(_CopyDC, XDest, YDest, Width, Height, SrcDC, XScr, YScr, Mask, xMask, yMask, Rop);
Result := ozMaskBlt(DestDC, XDest, YDest, Width, Height, SrcDC, XScr, YScr, Mask, xMask, yMask, Rop);
end;
function GetTextMetricsAHook(DC: HDC; var TM: TTextMetricA): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetTextMetricsA(_CopyDC, TM);
Result := ozGetTextMetricsA(DC, TM);
end;
function GetTextMetricsWHook(DC: HDC; var TM: TTextMetricW): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetTextMetricsW(_CopyDC, TM);
Result := ozGetTextMetricsW(DC, TM);
end;
function GetTextExtentPoint32AHook(DC: HDC; Str: LPCSTR; Count: Integer;
var Size: TSize): BOOL; overload; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetTextExtentPoint32A(_CopyDC, Str, Count, Size);
Result := ozGetTextExtentPoint32A(DC, Str, Count, Size);
end;
function GetTextExtentPoint32WHook(DC: HDC; Str: LPCWSTR; Count: Integer;
var Size: TSize): BOOL; overload; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetTextExtentPoint32W(_CopyDC, Str, Count, Size);
Result := ozGetTextExtentPoint32W(DC, Str, Count, Size);
end;
function GdiCommentHook(DC: HDC; p2: UINT; p3: LPSTR): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGdiComment(_CopyDC, p2, p3);
Result := ozGdiComment(DC, p2, p3);
end;
function GetCharABCWidthsAHook(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetCharABCWidthsA(_CopyDC, FirstChar, LastChar, ABCStructs);
Result := ozGetCharABCWidthsA(DC, FirstChar, LastChar, ABCStructs);
end;
function GetCharABCWidthsWHook(DC: HDC; FirstChar, LastChar: UINT; const ABCStructs): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGetCharABCWidthsW(_CopyDC, FirstChar, LastChar, ABCStructs);
Result := ozGetCharABCWidthsW(DC, FirstChar, LastChar, ABCStructs);
end;
function UpdateColorsHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozUpdateColors(_CopyDC);
Result := ozUpdateColors(DC);
end;
function OffsetViewportOrgExHook(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozOffsetViewportOrgEx(_CopyDC, X, Y, Points);
Result := ozOffsetViewportOrgEx(DC, X, Y, Points);
end;
function OffsetWindowOrgExHook(DC: HDC; X, Y: Integer; Points: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozOffsetWindowOrgEx(_CopyDC, X, Y, Points);
Result := ozOffsetWindowOrgEx(DC, X, Y, Points);
end;
function SetDeviceGammaRampHook(DC: HDC; var Ramp): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetDeviceGammaRamp(_CopyDC, Ramp);
Result := ozSetDeviceGammaRamp(DC, Ramp);
end;
function ColorMatchToTargetHook(DC: HDC; Target: HDC; Action: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozColorMatchToTarget(_CopyDC, Target, Action);
Result := ozColorMatchToTarget(DC, Target, Action);
end;
function PtVisibleHook(DC: HDC; X, Y: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPtVisible(_CopyDC, X, Y);
Result := ozPtVisible(DC, X, Y);
end;
function RectVisibleHook(DC: HDC; const Rect: TRect): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozRectVisible(_CopyDC, Rect);
Result := ozRectVisible(DC, Rect);
end;
function SetPixelFormatHook(DC: HDC; PixelFormat: Integer; FormatDef: PPixelFormatDescriptor): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetPixelFormat(_CopyDC, PixelFormat, FormatDef);
Result := ozSetPixelFormat(DC, PixelFormat, FormatDef);
end;
function SetStretchBltModeHook(DC: HDC; StretchMode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetStretchBltMode(_CopyDC, StretchMode);
Result := ozSetStretchBltMode(DC, StretchMode);
end;
function OffsetClipRgnHook(DC: HDC; XOffset, YOffset: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozOffsetClipRgn(_CopyDC, XOffset, YOffset);
Result := ozOffsetClipRgn(DC, XOffset, YOffset);
end;
function IntersectClipRectHook(DC: HDC; X1, Y1, X2, Y2: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozIntersectClipRect(_CopyDC, X1, Y1, X2, Y2);
Result := ozIntersectClipRect(DC, X1, Y1, X2, Y2);
end;
function SetTextCharacterExtraHook(DC: HDC; CharExtra: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetTextCharacterExtra(_CopyDC, CharExtra);
Result := ozSetTextCharacterExtra(DC, CharExtra);
end;
function EnumICMProfilesAHook(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumICMProfilesA(_CopyDC, ICMProc, p3);
Result := ozEnumICMProfilesA(DC, ICMProc, p3);
end;
function EnumICMProfilesWHook(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumICMProfilesW(_CopyDC, ICMProc, p3);
Result := ozEnumICMProfilesW(DC, ICMProc, p3);
end;
function ExtEscapeHook(DC: HDC; p2, p3: Integer; const p4: LPCSTR; p5: Integer; p6: LPSTR): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozExtEscape(_CopyDC, p2, p3, p4, p5, p6);
Result := ozExtEscape(DC, p2, p3, p4, p5, p6);
end;
function EnumFontsAHook(DC: HDC; lpszFace: LPCSTR; fntenmprc: TFNFontEnumProcA; lParam: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumFontsA(_CopyDC, lpszFace, fntenmprc, lParam);
Result := ozEnumFontsA(DC, lpszFace, fntenmprc, lParam);
end;
function EnumFontsWHook(DC: HDC; lpszFace: LPCWSTR; fntenmprc: TFNFontEnumProcW; lParam: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumFontsW(_CopyDC, lpszFace, fntenmprc, lParam);
Result := ozEnumFontsW(DC, lpszFace, fntenmprc, lParam);
end;
function EnumFontFamiliesAHook(DC: HDC; p2: LPCSTR; p3: TFNFontEnumProcA; p4: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumFontFamiliesA(_CopyDC, p2, p3, p4);
Result := ozEnumFontFamiliesA(DC, p2, p3, p4);
end;
function EnumFontFamiliesWHook(DC: HDC; p2: LPCWSTR; p3: TFNFontEnumProcW; p4: LPARAM): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEnumFontFamiliesW(_CopyDC, p2, p3, p4);
Result := ozEnumFontFamiliesW(DC, p2, p3, p4);
end;
function CreateCompatibleDCHook(DC: HDC): HDC; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozCreateCompatibleDC(_CopyDC);
Result := ozCreateCompatibleDC(DC);
end;
function CreateCompatibleBitmapHook(DC: HDC; Width, Height: Integer): HBITMAP; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozCreateCompatibleBitmap(_CopyDC, Width, Height);
Result := ozCreateCompatibleBitmap(DC, Width, Height);
end;
function SetMetaRgnHook(DC: HDC): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetMetaRgn(_CopyDC);
Result := ozSetMetaRgn(DC);
end;
function PlayEnhMetaFileHook(DC: HDC; p2: HENHMETAFILE; const p3: TRect): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPlayEnhMetaFile(_CopyDC, p2, p3);
Result := ozPlayEnhMetaFile(DC, p2, p3);
end;
function PlayEnhMetaFileRecordHook(DC: HDC; var p2: THandleTable; const p3: TEnhMetaRecord; p4: UINT): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
if p3.iType <> EMR_EXTCREATEFONTINDIRECTW then
ozPlayEnhMetaFileRecord(_CopyDC, p2, p3, p4);
end;
Result := ozPlayEnhMetaFileRecord(DC, p2, p3, p4);
end;
function SetPixelHook(DC: HDC; X, Y: Integer; Color: COLORREF): COLORREF; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetPixel(_CopyDC, X, Y, Color);
Result := ozSetPixel(DC, X, Y, Color);
end;
function SetPixelVHook(DC: HDC; X, Y: Integer; Color: COLORREF): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetPixelV(_CopyDC, X, Y, Color);
Result := ozSetPixelV(DC, X, Y, Color);
end;
function LineToHook(DC: HDC; X, Y: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozLineTo(_CopyDC, X, Y);
Result := ozLineTo(DC, X, Y);
end;
function PlgBltHook(DestDC: HDC; const PointsArray; SrcDC: HDC;
XSrc, YSrc, Width, Height: Integer; Mask: HBITMAP; xMask, yMask: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DestDC) then
ozPlgBlt(_CopyDC, PointsArray, SrcDC, XSrc, YSrc, Width, Height, Mask, xMask, yMask);
Result := ozPlgBlt(DestDC, PointsArray, SrcDC, XSrc, YSrc, Width, Height, Mask, xMask, yMask);
end;
function PatBltHook(DC: HDC; X, Y, Width, Height: Integer; Rop: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPatBlt(_CopyDC, X, Y, Width, Height, Rop);
Result := ozPatBlt(DC, X, Y, Width, Height, Rop);
end;
function MoveToExHook(DC: HDC; p2, p3: Integer; p4: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozMoveToEx(_CopyDC, p2, p3, p4);
Result := ozMoveToEx(DC, p2, p3, p4);
end;
function PolyBezierToHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyBezierTo(_CopyDC, Points, Count);
Result := ozPolyBezierTo(DC, Points, Count);
end;
function PolyLineToHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyLineTo(_CopyDC, Points, Count);
Result := ozPolyLineTo(DC, Points, Count);
end;
function PolyDrawHook(DC: HDC; const Points, Types; cCount: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyDraw(_CopyDC, Points, Types, cCount);
Result := ozPolyDraw(DC, Points, Types, cCount);
end;
function PolygonHook(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolygon(_CopyDC, Points, Count);
Result := ozPolygon(DC, Points, Count);
end;
function PolylineHook(DC: HDC; const Points; Count: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyline(_CopyDC, Points, Count);
Result := ozPolyline(DC, Points, Count);
end;
function PolyBezierHook(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyBezier(_CopyDC, Points, Count);
Result := ozPolyBezier(DC, Points, Count);
end;
function RectangleHook(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozRectangle(_CopyDC, X1, Y1, X2, Y2);
Result := ozRectangle(DC, X1, Y1, X2, Y2);
end;
function RoundRectHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozRoundRect(_CopyDC, X1, Y1, X2, Y2, X3, Y3);
Result := ozRoundRect(DC, X1, Y1, X2, Y2, X3, Y3);
end;
function BeginPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozBeginPath(_CopyDC);
Result := ozBeginPath(DC);
end;
function EndPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEndPath(_CopyDC);
Result := ozEndPath(DC);
end;
function FillPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozFillPath(_CopyDC);
Result := ozFillPath(DC);
end;
function FlattenPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozFlattenPath(_CopyDC);
Result := ozFlattenPath(DC);
end;
function WidenPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozWidenPath(_CopyDC);
Result := ozWidenPath(DC);
end;
function StrokePathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozStrokePath(_CopyDC);
Result := ozStrokePath(DC);
end;
function StrokeAndFillPathHook(DC: HDC): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozStrokeAndFillPath(_CopyDC);
Result := ozStrokeAndFillPath(DC);
end;
function SetDCBrushColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetDCBrushColor(_CopyDC, Color);
Result := ozSetDCBrushColor(DC, Color);
end;
function SetDCPenColorHook(DC: HDC; Color: COLORREF): COLORREF; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetDCPenColor(_CopyDC, Color);
Result := ozSetDCPenColor(DC, Color);
end;
function SetDIBColorTableHook(DC: HDC; p2, p3: UINT; var RGBQuadSTructs): UINT; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetDIBColorTable(_CopyDC, p2, p3, RGBQuadSTructs);
Result := ozSetDIBColorTable(DC, p2, p3, RGBQuadSTructs);
end;
function SetTextAlignHook(DC: HDC; Flags: UINT): UINT; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetTextAlign(_CopyDC, Flags);
Result := ozSetTextAlign(DC, Flags);
end;
function SetBkModeHook(DC: HDC; BkMode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetBkMode(_CopyDC, BkMode);
Result := ozSetBkMode(DC, BkMode);
end;
function GradientFillHook(DC: HDC; Vertex: PTriVertex; NumVertex: ULONG; Mesh: Pointer; NumMesh, Mode: ULONG): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozGradientFill(_CopyDC, Vertex, NumVertex, Mesh, NumMesh, Mode);
Result := ozGradientFill(DC, Vertex, NumVertex, Mesh, NumMesh, Mode);
end;
function FillRectHook(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
begin
if IsAblePrintDrawCopy(hDC) then
ozFillRect(_CopyDC, lprc, hbr);
Result := ozFillRect(hDC, lprc, hbr);
end;
function FrameRectHook(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
begin
if IsAblePrintDrawCopy(hDC) then
ozFrameRect(_CopyDC, lprc, hbr);
Result := ozFrameRect(hDC, lprc, hbr);
end;
function ExtFloodFillHook(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozExtFloodFill(_CopyDC, X, Y, Color, FillType);
Result := ozExtFloodFill(DC, X, Y, Color, FillType);
end;
function FloodFillHook(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozFloodFill(_CopyDC, X, Y, Color);
Result := ozFloodFill(DC, X, Y, Color);
end;
function FillRgnHook(DC: HDC; hrgn: HRGN; hbr: HBRUSH): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozFillRgn(_CopyDC, hrgn, hbr);
Result := ozFillRgn(DC, hrgn, hbr);
end;
function SetPolyFillModeHook(DC: HDC; PolyFillMode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetPolyFillMode(_CopyDC, PolyFillMode);
Result := ozSetPolyFillMode(DC, PolyFillMode);
end;
function DrawEscapeHook(DC: HDC; p2, p3: Integer; p4: LPCSTR): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozDrawEscape(_CopyDC, p2, p3, p4);
Result := ozDrawEscape(DC, p2, p3, p4);
end;
function PaintRgnHook(DC: HDC; RGN: HRGN): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPaintRgn(_CopyDC, RGN);
Result := ozPaintRgn(DC, RGN);
end;
function SetColorAdjustmentHook(DC: HDC; const p2: TColorAdjustment): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetColorAdjustment(_CopyDC, p2);
Result := ozSetColorAdjustment(DC, p2);
end;
function SetArcDirectionHook(DC: HDC; Direction: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetArcDirection(_CopyDC, Direction);
Result := ozSetArcDirection(DC, Direction);
end;
function SetViewportExtExHook(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetViewportExtEx(_CopyDC, XExt, YExt, Size);
Result := ozSetViewportExtEx(DC, XExt, YExt, Size);
end;
function SetViewportOrgExHook(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetViewportOrgEx(_CopyDC, X, Y, Point);
Result := ozSetViewportOrgEx(DC, X, Y, Point);
end;
function ScaleViewportExtExHook(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozScaleViewportExtEx(_CopyDC, XM, XD, YM, YD, Size);
Result := ozScaleViewportExtEx(DC, XM, XD, YM, YD, Size);
end;
function SetWindowExtExHook(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetWindowExtEx(_CopyDC, XExt, YExt, Size);
Result := ozSetWindowExtEx(DC, XExt, YExt, Size);
end;
function SelectClipRgnHook(DC: HDC; Region: HRGN): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSelectClipRgn(_CopyDC, Region);
Result := ozSelectClipRgn(DC, Region);
end;
function ExtSelectClipRgnHook(DC: HDC; Region: HRGN; Mode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozExtSelectClipRgn(_CopyDC, Region, Mode);
Result := ozExtSelectClipRgn(DC, Region, Mode);
end;
function SetICMModeHook(DC: HDC; Mode: Integer): Integer; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetICMMode(_CopyDC, Mode);
Result := ozSetICMMode(DC, Mode);
end;
function SetColorSpaceHook(DC: HDC; ColorSpace: HCOLORSPACE): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozSetColorSpace(_CopyDC, ColorSpace);
Result := ozSetColorSpace(DC, ColorSpace);
end;
function SaveDCHook(DC: HDC): Integer; stdcall;
begin
Result := ozSaveDC(DC);
if (Result <> 0) and IsAblePrintDrawCopy(DC) then
ozSaveDC(_CopyDC);
end;
function RestoreDCHook(DC: HDC; SavedDC: Integer): BOOL; stdcall;
begin
Result := ozRestoreDC(DC, SavedDC);
if Result and IsAblePrintDrawCopy(DC) then
ozRestoreDC(_CopyDC, SavedDC);
end;
function AngleArcHook(DC: HDC; p2, p3: Integer; p4: DWORD; p5, p6: Single): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozAngleArc(_CopyDC, p2, p3, p4, p5, p6);
Result := ozAngleArc(DC, p2, p3, p4, p5, p6);
end;
function ArcToHook(DC: HDC; RLeft, RTop, RRight, RBottom: Integer; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozArcTo(_CopyDC, RLeft, RTop, RRight, RBottom, X1, Y1, X2, Y2);
Result := ozArcTo(DC, RLeft, RTop, RRight, RBottom, X1, Y1, X2, Y2);
end;
function PolyPolylineHook(DC: HDC; const PointStructs; const Points; p4: DWORD): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyPolyline(_CopyDC, PointStructs, Points, p4);
Result := ozPolyPolyline(DC, PointStructs, Points, p4);
end;
function EllipseHook(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozEllipse(_CopyDC, X1, Y1, X2, Y2);
Result := ozEllipse(DC, X1, Y1, X2, Y2);
end;
function LPtoDPHook(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
if Points <> nil then
begin
// 속도 문제와 안정성문제(테스트 도중 행걸리는 현상 발생)가 있어 nCount가 1보다 크더라도 첫값만 넘기도록 처리
// 현재 1개의 값만 넘겨도 원본로그와 프린트원본에 문제가 발생하지 않음. 추후 문제 발생시 확인해보는 것을 추천 by mg
var pt: TPoint;
pt.X := Points.X;
pt.Y := Points.Y;
ozLPtoDP(_CopyDC, @pt, 1);
end else
ozLPtoDP(_CopyDC, Points, Count);
end;
Result := ozLPtoDP(DC, Points, Count);
end;
function DPtoLPHook(DC: HDC; Points: PPoint; Count: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
if Points <> nil then
begin
// 속도 문제와 안정성문제(테스트 도중 행걸리는 현상 발생)가 있어 nCount가 1보다 크더라도 첫값만 넘기도록 처리
// 현재 1개의 값만 넘겨도 원본로그와 프린트원본에 문제가 발생하지 않음. 추후 문제 발생시 확인해보는 것을 추천 by mg
var pt: TPoint;
pt.X := Points.X;
pt.Y := Points.Y;
ozDPtoLP(_CopyDC, @pt, 1);
end else
ozDPtoLP(_CopyDC, Points, Count);
end;
Result := ozDPtoLP(DC, Points, Count);
end;
function SelectObjectHook(DC: HDC; p2: HGDIOBJ): HGDIOBJ; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
begin
ozSelectObject(_CopyDC, p2);
end;
Result := ozSelectObject(DC, p2);
end;
function ChordHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozChord(_CopyDC, X1, Y1, X2, Y2, X3, Y3, X4, Y4);
Result := ozChord(DC, X1, Y1, X2, Y2, X3, Y3, X4, Y4);
end;
function ArcHook(hDC: HDC; left, top, right, bottom, startX, startY, endX, endY: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(hDC) then
ozArc(_CopyDC, left, top, right, bottom, startX, startY, endX, endY);
Result := ozArc(hDC, left, top, right, bottom, startX, startY, endX, endY);
end;
function PieHook(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPie(_CopyDC, X1, Y1, X2, Y2, X3, Y3, X4, Y4);
Result := ozPie(DC, X1, Y1, X2, Y2, X3, Y3, X4, Y4);
end;
function PolyPolygonHook(DC: HDC; var Points; var nPoints; p4: Integer): BOOL; stdcall;
begin
if IsAblePrintDrawCopy(DC) then
ozPolyPolygon(_CopyDC, Points, nPoints, p4);
Result := ozPolyPolygon(DC, Points, nPoints, p4);
end;
function ExtTextOutAHook(DC: HDC; X, Y: Integer; Options: Longint;
const Rect: PRect; Str: LPCSTR; Count: Longint; const Dx: PInteger): BOOL; stdcall;
var
sData: AnsiString;
begin
if IsAblePrintDrawCopy(DC) then
begin
// sData := AnsiString(Str);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
// gAppHook.Log(Format('ExtTextOutAHook() .. Str="%s"', [sData]));
var dwOpt: DWORD := Options;
case gAppHook.Helper.CurAppType of
catNotepad,
catHwp :
begin
if Options = ETO_IGNORELANGUAGE then
dwOpt := ETO_CLIPPED;
end;
end;
ozExtTextOutA(_CopyDC, X, Y, dwOpt, Rect, Str, Count, Dx);
// if gAppHook.hMemDC_ <> 0 then
// ozExtTextOutA(gAppHook.hMemDC_, X, Y, Options, Rect, Str, Count, Dx);
end;
Result := ozExtTextOutA(DC, X, Y, Options, Rect, Str, Count, Dx);
end;
procedure AuditBeforeText(hdcSrc, hdcMir: HDC; const Tag: string);
function XfToStr(const X: XFORM): string;
begin
Result := Format('[%.6f %.6f %.6f %.6f | %.6f %.6f]', [X.eM11,X.eM12,X.eM21,X.eM22,X.eDx,X.eDy]);
end;
var
gmS, gmM, mmS, mmM, taS, taM, bkS, bkM, ceS, ceM: Integer;
wS, wM, vS, vM: TSize;
woS, woM, voS, voM, cpS, cpM: TPoint;
XS, XM: XFORM;
begin
gmS := GetGraphicsMode(hdcSrc); gmM := GetGraphicsMode(hdcMir);
GetWorldTransform(hdcSrc, XS); GetWorldTransform(hdcMir, XM);
mmS := GetMapMode(hdcSrc); mmM := GetMapMode(hdcMir);
GetWindowExtEx(hdcSrc,wS); GetWindowExtEx(hdcMir,wM);
GetViewportExtEx(hdcSrc,vS); GetViewportExtEx(hdcMir,vM);
GetWindowOrgEx(hdcSrc,woS); GetWindowOrgEx(hdcMir,woM);
GetViewportOrgEx(hdcSrc,voS); GetViewportOrgEx(hdcMir,voM);
taS := GetTextAlign(hdcSrc); taM := GetTextAlign(hdcMir);
bkS := GetBkMode(hdcSrc); bkM := GetBkMode(hdcMir);
ceS := GetTextCharacterExtra(hdcSrc); ceM := GetTextCharacterExtra(hdcMir);
GetCurrentPositionEx(hdcSrc, @cpS);
GetCurrentPositionEx(hdcMir, @cpM);
gAppHook.Log(Format(
'AUDIT %s | GM S/M=%d/%d | X S=%s M=%s | MM S/M=%d/%d | WExt S/M=%dx%d/%dx%d | VExt S/M=%dx%d/%dx%d | WOrg S/M=%d,%d/%d,%d | VOrg S/M=%d,%d/%d,%d | TA S/M=%x/%x | BK S/M=%d/%d | CE S/M=%d/%d | CP S/M=%d,%d/%d,%d',
[Tag, gmS, gmM, XfToStr(XS), XfToStr(XM), mmS, mmM, wS.cx, wS.cy, wM.cx, wM.cy,
vS.cx, vS.cy, vM.cx, vM.cy, woS.X, woS.Y, woM.X, woM.Y, voS.X, voS.Y, voM.X, voM.Y,
taS, taM, bkS, bkM, ceS, ceM, cpS.X, cpS.Y, cpM.X, cpM.Y]));
end;
function ExtTextOutWHook(DC: HDC; X, Y: Integer; Options: Longint;
const Rect: PRect; Str: LPCWSTR; Count: Longint; const Dx: PInteger): BOOL; stdcall;
var
sData: String;
begin
if IsAblePrintDrawCopy(DC) then
begin
// ReplaceTextW(Str);
// sData := String(Str);
// SumString(gAppHook.Helper.sPtrText_, String(Str), ' ');
// gAppHook.Log(Format('ExtTextOutAHook() .. Str="%s"', [sData]));
var dwOpt: DWORD := Options;
case gAppHook.Helper.CurAppType of
catNotepad,
catHwp :
begin
if Options = ETO_IGNORELANGUAGE then
dwOpt := ETO_CLIPPED;
end;
end;
// if gAppHook.Helper.CurAppType = catPPT then
// begin
// if (X = 0) and (Y = 0) then
// begin
// var nX := Round(_xForm.eDx);
// var nY := Round(_xForm.eDy);
// ozExtTextOutW(_CopyDC, nX, nY, dwOpt, Rect, Str, Count, Dx);
// end else
// ozExtTextOutW(_CopyDC, X, Y, dwOpt, Rect, Str, Count, Dx);
// end else
// ozExtTextOutW(_CopyDC, X, Y, dwOpt, Rect, Str, Count, Dx);
// gAppHook.Log('ExtTextOutWHook() .. X=%d, Y=%d, Str=%s, Dx=%d', [X, Y, Str, Dx^]);
ozExtTextOutW(_CopyDC, X, Y, dwOpt, Rect, Str, Count, Dx);
if _nTmp = 0 then
begin
_nTmp := 1;
AuditBeforeText(DC, _CopyDC, 'Test');
end;
// if gAppHook.hMemDC_ <> 0 then
// ozExtTextOutW(gAppHook.hMemDC_, X, Y, Options, Rect, Str, Count, Dx);
end;
Result := ozExtTextOutW(DC, X, Y, Options, Rect, Str, Count, Dx);
end;
function DrawTextAHook(hDC: HDC; lpString: LPCSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
var
sData: AnsiString;
begin
// sData := AnsiString(lpString);
// gAppHook.SendText(sData);
// Result := ozDrawTextA(hDc, lpString, nCount, lpRect, uFormat);
// exit;
if IsAblePrintDrawCopy(hDC) then
begin
// ReplaceTextA(lpString);
// sData := AnsiString(lpString);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozDrawTextA(_CopyDC, lpString, nCount, lpRect, uFormat);
end;
Result := ozDrawTextA(hDc, lpString, nCount, lpRect, uFormat);
end;
function DrawTextWHook(hDC: HDC; lpString: LPCWSTR; nCount: Integer;
var lpRect: TRect; uFormat: UINT): Integer; stdcall;
var
sData: String;
begin
// sData := String(lpString);
// gAppHook.SendText(sData);
// Result := ozDrawTextW(hDc, lpString, nCount, lpRect, uFormat);
// exit;
if IsAblePrintDrawCopy(hDC) then
begin
// ReplaceTextW(lpString);
// sData := String(lpString);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozDrawTextW(_CopyDC, lpString, nCount, lpRect, uFormat);
end;
Result := ozDrawTextW(hDc, lpString, nCount, lpRect, uFormat);
end;
function DrawTextExAHook(DC: HDC; lpchText: LPCSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
var
sData: AnsiString;
begin
// ReplaceTextA(lpchText);
if IsAblePrintDrawCopy(DC) then
begin
// sData := AnsiString(lpchText);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozDrawTextExA(_CopyDC, lpchText, cchText, p4, dwDTFormat, DTParams);
end;
Result := ozDrawTextExA(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
end;
function DrawTextExWHook(DC: HDC; lpchText: LPCWSTR; cchText: Integer; var p4: TRect;
dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
var
sData: String;
begin
// ReplaceTextW(lpchText);
if IsAblePrintDrawCopy(DC) then
begin
// sData := String(lpchText);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozDrawTextExW(_CopyDC, lpchText, cchText, p4, dwDTFormat, DTParams);
// if gAppHook.Helper.hMemDC_ <> 0 then
// ozDrawTextExW(gAppHook.Helper.hMemDC_, lpchText, cchText, p4, dwDTFormat, DTParams);
end;
Result := ozDrawTextExW(DC, lpchText, cchText, p4, dwDTFormat, DTParams);
end;
function TextOutAHook(DC: HDC; X, Y: Integer; Str: LPCSTR; Count: Integer): BOOL; stdcall;
var
sData: AnsiString;
begin
// ReplaceTextA(Str);
if IsAblePrintDrawCopy(DC) then
begin
// sData := AnsiString(Str);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozTextOutA(_CopyDC, X, Y, Str, Count);
end;
Result := ozTextOutA(DC, X, Y, Str, Count);
end;
function TextOutWHook(DC: HDC; X, Y: Integer; Str: LPCWSTR; Count: Integer): BOOL; stdcall;
var
sData: String;
begin
// ReplaceTextW(Str);
if IsAblePrintDrawCopy(DC) then
begin
// sData := String(Str);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozTextOutW(_CopyDC, X, Y, Str, Count);
end;
Result := ozTextOutW(DC, X, Y, Str, Count);
end;
function PolyTextOutAHook(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
type
TArrayLPCSTR = array [0..0] of LPCSTR;
var
i: Integer;
begin
if IsAblePrintDrawCopy(DC) then
begin
try
// for i := 0 to Strings - 1 do
// begin
// SumString(gAppHook.Helper.sPtrText_, AnsiString(TArrayLPCSTR(PolyTextArray)[i]), ' ');
// end;
ozPolyTextOutA(_CopyDC, PolyTextArray, Strings);
except
// ..
end;
end;
Result := ozPolyTextOutA(DC, PolyTextArray, Strings);
end;
function PolyTextOutWHook(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
type
TArrayLPCWSTR = array [0..0] of LPCWSTR;
var
i: Integer;
begin
if IsAblePrintDrawCopy(DC) then
begin
try
// for i := 0 to Strings - 1 do
// begin
// SumString(gAppHook.Helper.sPtrText_, String(TArrayLPCWSTR(PolyTextArray)[i]), ' ');
// end;
ozPolyTextOutW(_CopyDC, PolyTextArray, Strings);
except
// ..
end;
end;
Result := ozPolyTextOutW(DC, PolyTextArray, Strings);
end;
function TabbedTextOutAHook(hDC: HDC; X, Y: Integer; lpString: LPCSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
var
sData: AnsiString;
begin
if IsAblePrintDrawCopy(hDC) then
begin
// ReplaceTextA(lpString);
// sData := AnsiString(lpString);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozTabbedTextOutA(_CopyDC, X, Y, lpString, nCount, nTabPositions,
lpnTabStopPositions, nTabOrigin);
end;
Result := ozTabbedTextOutA(hDC, X, Y, lpString, nCount, nTabPositions,
lpnTabStopPositions, nTabOrigin);
end;
function TabbedTextOutWHook(hDC: HDC; X, Y: Integer; lpString: LPCWSTR; nCount, nTabPositions: Integer;
var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
var
sData: String;
begin
if IsAblePrintDrawCopy(hDC) then
begin
// ReplaceTextW(lpString);
// sData := String(lpString);
// SumString(gAppHook.Helper.sPtrText_, sData, ' ');
ozTabbedTextOutW(_CopyDC, X, Y, lpString, nCount, nTabPositions,
lpnTabStopPositions, nTabOrigin);
end;
Result := ozTabbedTextOutW(hDC, X, Y, lpString, nCount, nTabPositions,
lpnTabStopPositions, nTabOrigin);
end;
//initialization
//
//finalization
end.