Board index » delphi » SetDDIHook Documentation

SetDDIHook Documentation

Hello,

I know I'm beating this to death.....but does anyone know where I can find
some solid documentation on SetDDIHook?  I found descriptions and such
online in the Microsoft Platform SDK....and it told me the functions and
constants are defined in WINDDI.H.....so I figured if I downloaded the
SDK....chances are that file would come with it....1.5GB later....and no
WINDDI.H......in fact, no reference to SetDDIHook at all in any file, except
the description of it and a few related functions.

Can someone tell me where I can find some info on it?  The Descriptions of
the functions are useless without at least the values of the different
constants they mention.

Thanks,

Wayne Conway

 

Re:SetDDIHook Documentation


Hi Wayne,

Quote
> I know I'm beating this to death.....but does anyone know where I can find
> some solid documentation on SetDDIHook?
> Can someone tell me where I can find some info on it?  The Descriptions of
> the functions are useless without at least the values of the different
> constants they mention.

You have entered some very obscure area here. 18 months ago I have already tried
to figure out how this all works. Although there is nearly no help I got the
stuff I needed working. DDI hooks are part of the accessibility toolkit meant
mainly for disabled people (e.g. to hook text output and read it to blind men).
This SDK has never really made it to the public so be prepared for an
adventurous journey. You will need perseverance and inveteracy paired with a
perverse {*word*60}ion to experimenting :o] To get you started find below a partial
translation of WinDDI.h along with some internal data structures for fonts. You
will get this nowhere else, I think. But please don't ask me about every detail.
I'm not allowed to present you all the tricks...

unit WinDDI;

interface

{$A+}
{$F+}

uses WinTypes, WinProcs;

{some WinAPI stuff not declared in D1}

const
  ETO_GLYPH_INDEX = $0010;
  ETO_BYTE_PACKED = $0100;
  ETO_BIT_PACKED = $0200;
  ETO_LEVEL_MODE = $1000;

  NF_BYTE_PACKED = $0001;
  NF_BIT_PACKED = $0002;
  NF_FROM_BMP = $0040;
  NF_LARGE = $0080;

  {font type indicators used in the TFontInfo}
  FSF_FIXED = $0001;           {Font is fixed pitch.}
  FSF_PROPORTIONAL = $0002;    {Font is proportional pitch}
  FSF_ABCFIXED = $0004;        {Font is an ABC fixed font. The advance width for
each character in the font
                                is the sum of the dfAspace, dfBspace, and
dfCspace members.}
  FSF_ABCPROPORTIONAL = $0008; {Font is an ABC proportional font.}

const
  {Classes of DDI hooks}
  DDIHOOK_MIN = $0000;
  DDIHOOK_RECORDER = $0001;
  DDIHOOK_REMOTE = $0002;
  DDIHOOK_FONTS = $0003;
  DDIHOOK_MAGNIFIER = $0004;
  DDIHOOK_MAX = $0005;

  DDI_BITBLT              = $0000;
  DDI_COLORINFO           = $0001;
  DDI_CONTROL             = $0002;
  DDI_DISABLE             = $0003;
  DDI_ENABLE              = $0004;
  DDI_ENUMDEVICEFONTS     = $0005;
  DDI_ENUMOBJECTS         = $0006;
  DDI_OUTPUT              = $0007;
  DDI_PIXEL               = $0008;
  DDI_REALIZEOBJECT       = $0009;
  DDI_STRINGBLT           = $000A;
  DDI_SCANLEFTRIGHT       = $000B;
  DDI_DEVICEMODE          = $000C;
  DDI_EXTTEXTOUT          = $000D;
  DDI_GETCHARWIDTH        = $000E;
  DDI_DEVICEBITMAP        = $000F;
  DDI_FASTBORDER          = $0010;
  DDI_SETATTRIBUTE        = $0011;
  DDI_DIBBLT              = $0012;
  DDI_CREATEDIBITMAP      = $0013;
  DDI_DIBTODEVICE         = $0014;
  DDI_SETPALETTE          = $0015;
  DDI_GETPALETTE          = $0016;
  DDI_SETPALETTETRANSLATE = $0017;
  DDI_GETPALETTETRANSLATE = $0018;
  DDI_UPDATECOLORS        = $0019;
  DDI_STRETCHBLT          = $001A;
  DDI_STRETCHDIBITS       = $001B;
  DDI_SELECTBITMAP        = $001C;
  DDI_BITMAPBITS          = $001D;
  DDI_REENABLE            = $001E;
  DDI_GAMMARAMP           = $001F;
  DDI_ICMCOLORINFO        = $0020;

type
  DWORD = Longint;
  PDWORD = ^DWORD;

  PTextXForm = ^TTextXForm;
  TTextXForm = packed record
    ftHeight,
    ftWidth,
    ftEscapement,
    ftOrientation,
    ftWeight: SmallInt;
    ftItalic,
    ftUnderline,
    ftStrikeOut,
    ftOutPrecision,
    ftClipPrecision: Byte;
    ftAccelerator,
    ftOverhang: SmallInt;
  end;

  PDrawMode = ^TDrawMode;
  TDrawMode = packed record
    Rop2,
    bkMode: SmallInt;
    bkColor,
    TextColor: DWORD;
    TBreakExtra,
    BreakExtra,
    BreakErr,
    BreakRem,
    BreakCount,
    CharExtra: SmallInt;
    LbkColor,
    LTextColor,
    ICMCXform: DWORD;
    StretchBltMode: SmallInt;
    eMiterLimit: DWORD;
  end;

  PFontInfo = ^TFontInfo;
  TFontInfo = packed record
    dfType,
    dfPoints,
    dfVertRes,
    dfHorizRes,
    dfAscent,
    dfInternalLeading,
    dfExternalLeading: SmallInt;
    dfItalic,
    dfUnderline,
    dfStrikeOut: Byte;
    dfWeight: SmallInt;
    dfCharSet: Byte;
    dfPixWidth,
    dfPixHeight: SmallInt;
    dfPitchAndFamily: Byte;
    dfAvgWidth,
    dfMaxWidth: Smallint;
    dfFirstChar,
    dfLastChar,
    dfDefaultChar,
    dfBreakChar: Byte;
    dfWidthBytes: SmallInt;
    dfDevice,
    dfFace,
    dfBitsPointer,
    dfBitsOffset: DWORD;
    dfReserved: Byte;
    dfFlags: Longint;                    {Windows 3.x fonts only}
    dfAspace,                            {Windows 3.x fonts only}
    dfBspace,                            {Windows 3.x fonts only}
    dfCspace: SmallInt;                  {Windows 3.x fonts only}
    dfColorPointer: Longint;             {4 bytes specifying the offset to the
color table for
                                          color fonts, if any. The format of the
bits is similar
                                          to a DIB, but without the header. That
is, the
                                          characters are not split up into
disjoint bytes.
                                          Instead, they are left intact. If no
color table is
                                          needed, this entry is NULL.
                                          [NOTE: This information is different
from that in the
                                          hard-copy Developer's Notes and
reflects a correction.]}
    dfReserved1: array[0..3] of Longint; {reserved; do not use.}
    dfCharTable: record end;             {This is an array of structures which
depend very much on the type of the font.
                                          Four cases are possible:
                                            - raster fonts: (
                                              * Windows 2.x fonts:
TGlyphEntryFakeName
                                              * Windows 3.0 fonts:
TRasterGlyphEntry
                                            - vector fonts:
                                              * fixed pitched:
TVectorFixedGlyphEntry
                                              * variable pitched fonts:
TVectorGlyphEntry

                                          This array contains (dfLastChar -
dfFirstChar) + 2 entries (one dummy at the end)
                                          and is indexed by the character in
question minus dfFirstChar.

                                          Windows 2.x fonts are no longer used.
Actually for Win2.x fonts dfCharTable would
                                          start immediately afterdfReserved.

                                          Raster fonts are indicated by a
cleared LSB in dfType else it is a vector font.
                                          Variable pitch is indicated by a set
LSB in dfPitchAndFamily else it is a
                                          fixed pitched font.
                                         }
  end;

  TGlyphEntryFakeName = packed record  {for raster fonts only, Win2.x style}
    CharWidth,
    Offset: Word;
  end;

  TRasterGlyphEntry = packed record  {for variable-pitch raster fonts only (use
dfPixWidth for fixed pitch fonts)}
    {geWidth: Word;}  {ml: it looks like there's no width entry at all}
    geOffset: Word;
  end;
  PRasterGlyphArray = ^TRasterGlyphArray;
  TRasterGlyphArray = array[0..0] of TRasterGlyphEntry;

  TVectorFixedGlyphEntry = record    {for fixed pitched vector fonts only, use
dfPixWidth for width calculation}
    Offset: Word;
  end;

  TVectorGlyphEntry = record         {for variable pitched vector fonts only}
    vgeOffset,
    vgeWidth: SmallInt;
  end;
  PVectorGlyphArray = ^TVectorGlyphArray;
  TVectorGlyphArray = array[0..0] of TVectorGlyphEntry;

  {this structure is alternatively used instead of TFontInfo if marked in
uOptions by ETO_BYTE_PACKED or ETO_BIT_PACKED}
  PNewFontSeg = ^TNewFontSeg;
  TNewFontSeg = packed record
    nfVersion,                           {for Win95 always $0400}
    nfFormat,                            {see NF_xxx flags}
    nfNumGlyphs: Word;
    nfGlyphOffset,
    nfAWTable: DWORD;
    nfHeight,
    nfAscent: Word;
    nfUniqueID: DWORD;
  end;

  PPDevice = ^TPDevice;
  TPDevice = packed record
    pdType: SmallInt;
  end;

  PBitBltDDIParams = ^TBitBltDDIParams;
  TBitBltDDIParams = packed record
    lpDrawMode: PDrawMode;
    lpPBrush: Pointer; {PBrush, a BRUSHOBJ structure, see "Undocumented
Windows"}
    dwRop: DWORD;
    cySrc,
    cxSrc,
    ySrc,
    xSrc: Integer;
    lpDevSrc: PPDevice;
    yDst,
    xDst: Integer;
    lpDevDst: PPDevice;
  end;

  PTextOutDDIParams = ^TTextOutDDIParams;
  TTextOutDDIParams = packed record
    uOptions: Word;
    lprcOpaque: PRect;
    lpCharWidths: PInteger;
    lpTextTransform: PTextXForm;
    lpDrawMode: PDrawMode;
    lpFont: PFontInfo;
    cchText: Integer;
    lpszText: PStr;
    lprcClip: PRect;
    yStart,
    xStart: Integer;
    lpDev: PPDevice;
  end;

  PStringBlitDDIParams = ^TStringBlitDDIParams;
  TStringBlitDDIParams = packed record
    lpTextTransform: PTextXForm;
    lpDrawMode: PDrawMode;
    lpFont: PFontInfo;
    cchText: Word;
    lpszText: PStr;
    lprcClip: PRect;
    yStart,
    xStart: Integer;
    lpDev: PPDevice;
  end;

  HDDI = Pointer;
  TDDITYPE = Word;
  PDDIParams = Pointer;

  TDDIHookProc = function(DDI: HDDI; PrivateData: Pointer; DDIType: TDDIType;
DDIParams: PDDIParams): DWORD;

{DDI hook functions}
function SetDDIHook(DC: HDC; ModeCode: THandle; PrivateData: Pointer; HookClass:
Word; HookProc: TDDIHookProc): HDDI;
function UnhookDDI(DDI: HDDI): Bool;
function CallNextDDI(DDI: HDDI; DDIType: TDDIType; DDIParams: PDDIParams):
DWORD;

{-------------------------------------------------------------------------------
---------------------------------------}

implementation

function SetDDIHook; external 'GDI.exe' index 750;
function UnhookDDI; external 'GDI.exe' index 751;
function CallNextDDI; external 'GDI.exe' index 752;
...

read more »

Re:SetDDIHook Documentation


Perhaps the original file is interesting as well. You can see there isn't even a
copyright notice of Microsoft...

Ciao, Mike

// --------------------------------------------------------------------------
//
//  WINDDI.H
//
//  Hooking mechanism to see all screen output.
//
//  NOTE:  You must include GDIDEFS.INC from the DDK to get the definitions
//  of the structures used in this file.
//
// --------------------------------------------------------------------------

#ifndef _WINDDI_
#define _WINDDI_

#if !defined(_WINDDI_)
#define WINDDIAPI   DECLSPEC_IMPORT
#else
#define WINDDIAPI
#endif

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

//
// Forward declarations of structures passed as various DDI parameters
//

typedef struct tagPDEVICE FAR*      LPPDEVICE;
typedef struct tagDRAWESCAPE FAR*   LPDRAWESCAPE;
typedef struct tagDISPVALMODE FAR*  LPDISPVALMODE;
typedef struct tagCOLORINFO FAR*    LPCOLORINFO;
typedef struct tagPPEN FAR*         LPPPEN;
typedef struct tagPBRUSH FAR*       LPPBRUSH;
typedef struct tagFONTINFO FAR*     LPFONTINFO;
typedef struct tagTEXTXFORM FAR*    LPTEXTXFORM;
typedef struct tagDEVMODE FAR*      LPDEVMODE;

typedef struct tagDDI FAR* HDDI;

//
// Classes of DDI hooks
//
#define DDIHOOK_MIN             0x0000
#define DDIHOOK_RECORDER        0x0001
#define DDIHOOK_REMOTE          0x0002
#define DDIHOOK_FONTS           0x0003
#define DDIHOOK_MAGNIFIER       0x0004
#define DDIHOOK_MAX             0x0005

//
// DDIs
//
typedef UINT    DDITYPE;
typedef LPVOID  LPDDIPARAMS;

typedef DWORD (CALLBACK* DDIHOOKPROC)(HDDI, LONG, DDITYPE, LPDDIPARAMS);

WINDDIAPI
HDDI
WINAPI
SetDDIHook(
    HDC         hdcHook,
    HMODULE     hModCode,
    LONG        lPrivateData,
    UINT        hookClass,
    DDIHOOKPROC lpfnDdiHook
);

WINDDIAPI
BOOL
WINAPI
UnhookDDIHook(
    HDDI        hddi
);

WINDDIAPI
DWORD
WINAPI
CallNextDDI(
    HDDI            hddi,
    DDITYPE         ddiType,
    LPDDIPARAMS     lpDdiParams
);

//
// The DDIs you can hook currently:
//
#define DDI_BITBLT              0x0000
typedef struct tagBITBLT_DDIPARAMS
{
    LPDRAWMODE      lpDrawMode;
    LPPBRUSH        lpPBrush;
    DWORD           dwRop;
    int             cySrc;
    int             cxSrc;
    int             ySrc;
    int             xSrc;
    LPPDEVICE       lpDevSrc;
    int             yDst;
    int             xDst;
    LPPDEVICE       lpDevDst;

Quote
}

BITBLT_DDIPARAMS, FAR* LPBITBLT_DDIPARAMS;

#define DDI_COLORINFO           0x0001
typedef struct tagCOLORINFO_DDIPARAMS
{
    LPVOID          lpPhysBits;
    DWORD           rgbColor;
    LPPDEVICE       lpDev;

Quote
}

COLORINFO_DDIPARAMS, FAR* LPCOLORINFO_DDIPARAMS;

#define DDI_CONTROL             0x0002
typedef struct tagCONTROL_DDIPARAMS
{
    LPVOID          lpOutData;
    LPVOID          lpInData;
    UINT            uCode;
    LPPDEVICE       lpDev;

Quote
}

CONTROL_DDIPARAMS, FAR* LPCONTROL_DDIPARAMS;

#define DDI_DISABLE             0x0003
typedef struct tagDISABLE_DDIPARAMS
{
    LPPDEVICE       lpDev;

Quote
}

DISABLE_DDIPARAMS, FAR* LPDISABLE_DDIPARAMS;

#define DDI_ENABLE              0x0004
typedef struct tagENABLE_DDIPARAMS
{
    LPVOID          lpDriverInfo;
    LPSTR           lpOutputFile;
    LPSTR           lpDeviceType;
    UINT            uStyle;
    LPPDEVICE       lpDev;

Quote
}

ENABLE_DDIPARAMS, FAR* LPENABLE_DDIPARAMS;

#define DDI_ENUMDEVICEFONTS     0x0005
typedef struct tagENUMDEVICEFONTS_DDIPARAMS
{
    LPVOID          lpClientData;
    FARPROC         lpfnCallback;
    LPSTR           lpszFaceName;
    LPPDEVICE       lpDev;

Quote
}

ENUMDEVICEFONTS_DDIPARAMS, FAR* LPENUMDEVICEFONTS_DDIPARAMS;

#define DDI_ENUMOBJECTS         0x0006
typedef struct tagENUMOBJECTS_DDIPARAMS
{
    LPVOID          lpClientData;
    FARPROC         lpfnCallback;
    UINT            uStyle;
    LPPDEVICE       lpDev;

Quote
}

ENUMOBJECTS_DDIPARAMS, FAR* LPENUMOBJECTS_DDIPARAMS;

#define DDI_OUTPUT              0x0007
typedef struct tagOUTPUT_DDIPARAMS
{
    LPRECT          lprcClip;
    LPDRAWMODE      lpDrawMode;
    LPPBRUSH        lpBrush;
    LPPPEN          lpPen;
    LPPOINT         lpPoints;
    UINT            uPointCount;
    UINT            uStyle;
    LPPDEVICE       lpDev;

Quote
}

OUTPUT_DDIPARAMS, FAR* LPOUTPUT_DDIPARAMS;

#define DDI_PIXEL               0x0008
typedef struct tagPIXEL_DDIPARAMS
{
    LPDRAWMODE      lpDrawMode;
    DWORD           rgbColor;
    int             y;
    int             x;
    LPPDEVICE       lpDev;

Quote
}

PIXEL_DDIPARAMS, FAR* LPPIXEL_DDIPARAMS;

#define DDI_REALIZEOBJECT       0x0009
typedef struct tagREALIZEOBJECT_DDIPARAMS
{
    LPTEXTXFORM     lpTextTransform;
    LPVOID          lpOutObject;
    LPVOID          lpInObject;
    UINT            uObjectId;
    LPPDEVICE       lpDev;

Quote
}

REALIZEOBJECT_DDIPARAMS, FAR* LPREALIZEOBJECT_DDIPARAMS;

#define DDI_STRINGBLT           0x000A
typedef struct tagSTRINGBLT_DDIPARAMS
{
    LPTEXTXFORM     lpTextTransform;
    LPDRAWMODE      lpDrawMode;
    LPFONTINFO      lpFont;
    UINT            cchText;
    LPSTR           lpszText;
    LPRECT          lprcClip;
    int             yStart;
    int             xStart;
    LPPDEVICE       lpDev;

Quote
}

STRINGBLT_DDIPARAMS, FAR* LPSTRINGBLT_DDIPARAMS;

#define DDI_SCANLEFTRIGHT       0x000B
typedef struct taSCANLEFTRIGHT_DDIPARAMS
{
    UINT            uStyle;
    DWORD           rgbSearch;
    int             yStart;
    int             xStart;
    LPPDEVICE       lpDev;

Quote
}

SCANLEFTRIGHT_DDIPARAMS, FAR* LPSCANLEFTRIGHT_DDIPARAMS;

#define DDI_DEVICEMODE          0x000C
typedef struct tagDEVICEMODE_DDIPARAMS
{
    LPSTR           lpFileName;
    LPSTR           lpDeviceName;
    HMODULE         hmod;
    HWND            hwnd;

Quote
}

DEVICEMODE_DDIPARAMS, FAR* LPDEVICEMODE_DDIPARAMS;

#define DDI_EXTTEXTOUT          0x000D
typedef struct tagEXTTEXTOUT_DDIPARAMS
{
    UINT            uOptions;
    LPRECT          lprcOpaque;
    LPINT           lpCharWidths;
    LPTEXTXFORM     lpTextTransform;
    LPDRAWMODE      lpDrawMode;
    LPFONTINFO      lpFont;
    int             cchText;
    LPSTR           lpszText;
    LPRECT          lprcClip;
    int             yStart;
    int             xStart;
    LPPDEVICE       lpDev;

Quote
}

EXTTEXTOUT_DDIPARAMS, FAR* LPEXTTEXTOUT_DDIPARAMS;

#define DDI_GETCHARWIDTH        0x000E
typedef struct tagGETCHARWIDTH_DDIPARAMS
{
    LPTEXTXFORM     lpTextTransform;
    LPDRAWMODE      lpDrawMode;
    LPFONTINFO      lpFont;
    UINT            ichLast;
    UINT            ichFirst;
    LPVOID          lpWidths;
    LPPDEVICE       lpDev;

Quote
}

GETCHARWIDTH_DDIPARAMS, FAR* LPGETCHARWIDTH_DDIPARAMS;

#define DDI_DEVICEBITMAP        0x000F
typedef struct tagDEVICEBITMAP_DDIPARAMS
{
    LPVOID          lpBits;
    LPVOID          lpBitmap;
    UINT            uCommand;
    LPPDEVICE       lpDev;

Quote
}

DEVICEBITMAP_DDIPARAMS, FAR* LPDEVICEBITMAP_DDIPARAMS;

#define DDI_FASTBORDER          0x0010
typedef struct tagFASTBORDER_DDIPARAMS
{
    LPRECT          lprcClip;
    LPDRAWMODE      lpDrawMode;
    LPPBRUSH        lpPBrush;
    LPPDEVICE       lpDev;
    DWORD           dwRop;
    UINT            cyBorder;
    UINT            cxBorder;
    LPRECT          lprcFrame;

Quote
}

FASTBORDER_DDIPARAMS, FAR* LPFASTBORDER_DDIPARAMS;

#define DDI_SETATTRIBUTE        0x0011
typedef struct tagSETATTRIBUTE_DDIPARAMS
{
    DWORD           dwAttribute;
    UINT            uIndex;
    UINT            uStateNum;
    LPPDEVICE       lpDev;

Quote
}

SETATTRIBUTE_DDIPARAMS, FAR* LPSETATTRIBUTE_DDIPARAMS;

#define DDI_DIBBLT              0x0012
typedef struct tagDIBBLT_DDIPARAMS
{
    LPCOLORINFO     lpColorInfo;
    LPDRAWMODE      lpDrawMode;
    LPBITMAPINFO    lpBitmapInfo;
    LPVOID          lpBits;
    UINT            cScans;
    UINT            iScan;
    BOOL            fGet;
    LPPDEVICE       lpDev;

Quote
}

DIBBLT_DDIPARAMS, FAR* LPDIBBLT_DDIPARAMS;

#define DDI_CREATEDIBITMAP      0x0013
typedef struct tagCREATEDIBITMAP_DDIPARAMS
{
    DWORD       dwDummyNotReallyHere;

Quote
}

CREATEDIBITMAP_DDIPARAMS, FAR* LPCREATEDIBITMAP_DDIPARAMS;

#define DDI_DIBTODEVICE         0x0014
typedef struct tagDIBTODEVICE_DDIPARAMS
{
    LPCOLORINFO     lpColorInfo;
    LPBITMAPINFO    lpBitmapInfo;
    LPVOID          lpBits;
    LPDRAWMODE      lpDrawMode;
    LPRECT          lprcClip;
    UINT            cScans;
    UINT            iScan;
    int             yStart;
    int             xStart;
    LPPDEVICE       lpDev;

Quote
}

DIBTODEVICE_DDIPARAMS, FAR* LPDIBTODEVICE_DDIPARAMS;

#define DDI_SETPALETTE          0x0015
#define DDI_GETPALETTE          0x0016
typedef struct tagGETSETPALETTE_DDIPARAMS
{
    LPPDEVICE       lpDevice;
    LPVOID          lpPalette;
    UINT            cEntries;
    UINT            iEntryStart;

Quote
}

GETSETPALETTE_DDIPARAMS, FAR* LPGETSETPALETTE_DDIPARAMS;

#define DDI_SETPALETTETRANSLATE 0x0017
#define DDI_GETPALETTETRANSLATE 0x0018
typedef struct tagGETSETPALETTETRANSLATE_DDIPARAMS
{
    LPPDEVICE       lpDevice;
    LPVOID          lpColorTranslateTable;

Quote
}

GETSETPALETTETRANSLATE_DDIPARAMS, FAR* LPGETSETPALETTETRANSLATE_DDIPARAMS;

#define DDI_UPDATECOLORS        0x0019
typedef struct tagUPDATECOLORS_DDIPARAMS
{
    LPPDEVICE       lpDevice;
    LPCOLORINFO     lpColorInfo;
    int             cyUpdate;
    int             cxUpdate;
    int             yStart;
    int             xStart;

Quote
}

UPDATECOLORS_DDIPARAMS, FAR* LPUPDATECOLORS_DDIPARAMS;

#define DDI_STRETCHBLT          0x001A
typedef struct tagSTRETCHBLT_DDIPARAMS
{
    LPRECT          lprcClip;
    LPDRAWMODE      lpDrawMode;
    LPPBRUSH        lpPBrush;
    DWORD           dwRop;
    int             cySrc;
    int             cxSrc;
    int             ySrc;
    int             xSrc;
    LPPDEVICE       lpDevSrc;
    int             cyDst;
    int             cxDst;
    int             yDst;
    int             xDst;
    LPPDEVICE       lpDevDst;

Quote
}

STRETCHBLT_DDIPARAMS, FAR* LPSTRETCHBLT_DDIPARAMS;

#define DDI_STRETCHDIBITS       0x001B
typedef struct tagSTRETCHDIBITS_DDIPARAMS
{
    LPRECT        
...

read more »

Re:SetDDIHook Documentation


Mike,

Thank-you!!!!

That was all I was needing...somewhere to actually start!!!   Without at
least the values of constants and such....it is very difficult to really do
anything.   Now I can at least mess around and start seeing what things do.
Thanks again!  I've been looking for WINDDI.h for weeks but without any
luck.

Thankyou, Thankyou, Thanks for your help, Thankyou, Thanks Again, You Rock,
Thankyou, Thanks, Thanks for everything, Thanks, Thankyou, Thankyou, Thanks
for your help, Thankyou, Thanks Again, You Rock, Thankyou, Thanks, Thanks
for everything, Thanks, Thankyou, Thankyou, Thanks for your help, Thankyou,
Thanks Again, You Rock, Thankyou, Thanks, Thanks for everything, Thanks,
Thankyou, Thankyou, Thanks for your help, Thankyou, Thanks Again, You Rock,
Thankyou, Thanks, Thanks for everything, Thanks, Thankyou, Thankyou, Thanks
for your help, Thankyou, Thanks Again, You Rock, Thankyou, Thanks, Thanks
for everything, Thanks, Thankyou, Thankyou, Thanks for your help, Thankyou,
Thanks Again, You Rock, Thankyou, Thanks, Thanks for everything, Thanks,
Thankyou, Thankyou, Thanks for your help, Thankyou, Thanks Again, You Rock,
Thankyou, Thanks, Thanks for everything, Thanks,

:)

Wayne Conway

"Mike Lischke (Team JEDI)" <pub...@lischke-online.de> wrote in message
news:3ac1da84_2@dnews...

Quote
> Hi Wayne,

> > I know I'm beating this to death.....but does anyone know where I can
find
> > some solid documentation on SetDDIHook?
> > Can someone tell me where I can find some info on it?  The Descriptions
of
> > the functions are useless without at least the values of the different
> > constants they mention.

> You have entered some very obscure area here. 18 months ago I have already
tried
> to figure out how this all works. Although there is nearly no help I got
the
> stuff I needed working. DDI hooks are part of the accessibility toolkit
meant
> mainly for disabled people (e.g. to hook text output and read it to blind
men).
> This SDK has never really made it to the public so be prepared for an
> adventurous journey. You will need perseverance and inveteracy paired with
a
> perverse {*word*60}ion to experimenting :o] To get you started find below a
partial
> translation of WinDDI.h along with some internal data structures for
fonts. You
> will get this nowhere else, I think. But please don't ask me about every
detail.
> I'm not allowed to present you all the tricks...

> unit WinDDI;

> interface

> {$A+}
> {$F+}

> uses WinTypes, WinProcs;

> {some WinAPI stuff not declared in D1}

> const
>   ETO_GLYPH_INDEX = $0010;
>   ETO_BYTE_PACKED = $0100;
>   ETO_BIT_PACKED = $0200;
>   ETO_LEVEL_MODE = $1000;

>   NF_BYTE_PACKED = $0001;
>   NF_BIT_PACKED = $0002;
>   NF_FROM_BMP = $0040;
>   NF_LARGE = $0080;

>   {font type indicators used in the TFontInfo}
>   FSF_FIXED = $0001;           {Font is fixed pitch.}
>   FSF_PROPORTIONAL = $0002;    {Font is proportional pitch}
>   FSF_ABCFIXED = $0004;        {Font is an ABC fixed font. The advance
width for
> each character in the font
>                                 is the sum of the dfAspace, dfBspace, and
> dfCspace members.}
>   FSF_ABCPROPORTIONAL = $0008; {Font is an ABC proportional font.}

> const
>   {Classes of DDI hooks}
>   DDIHOOK_MIN = $0000;
>   DDIHOOK_RECORDER = $0001;
>   DDIHOOK_REMOTE = $0002;
>   DDIHOOK_FONTS = $0003;
>   DDIHOOK_MAGNIFIER = $0004;
>   DDIHOOK_MAX = $0005;

>   DDI_BITBLT              = $0000;
>   DDI_COLORINFO           = $0001;
>   DDI_CONTROL             = $0002;
>   DDI_DISABLE             = $0003;
>   DDI_ENABLE              = $0004;
>   DDI_ENUMDEVICEFONTS     = $0005;
>   DDI_ENUMOBJECTS         = $0006;
>   DDI_OUTPUT              = $0007;
>   DDI_PIXEL               = $0008;
>   DDI_REALIZEOBJECT       = $0009;
>   DDI_STRINGBLT           = $000A;
>   DDI_SCANLEFTRIGHT       = $000B;
>   DDI_DEVICEMODE          = $000C;
>   DDI_EXTTEXTOUT          = $000D;
>   DDI_GETCHARWIDTH        = $000E;
>   DDI_DEVICEBITMAP        = $000F;
>   DDI_FASTBORDER          = $0010;
>   DDI_SETATTRIBUTE        = $0011;
>   DDI_DIBBLT              = $0012;
>   DDI_CREATEDIBITMAP      = $0013;
>   DDI_DIBTODEVICE         = $0014;
>   DDI_SETPALETTE          = $0015;
>   DDI_GETPALETTE          = $0016;
>   DDI_SETPALETTETRANSLATE = $0017;
>   DDI_GETPALETTETRANSLATE = $0018;
>   DDI_UPDATECOLORS        = $0019;
>   DDI_STRETCHBLT          = $001A;
>   DDI_STRETCHDIBITS       = $001B;
>   DDI_SELECTBITMAP        = $001C;
>   DDI_BITMAPBITS          = $001D;
>   DDI_REENABLE            = $001E;
>   DDI_GAMMARAMP           = $001F;
>   DDI_ICMCOLORINFO        = $0020;

> type
>   DWORD = Longint;
>   PDWORD = ^DWORD;

>   PTextXForm = ^TTextXForm;
>   TTextXForm = packed record
>     ftHeight,
>     ftWidth,
>     ftEscapement,
>     ftOrientation,
>     ftWeight: SmallInt;
>     ftItalic,
>     ftUnderline,
>     ftStrikeOut,
>     ftOutPrecision,
>     ftClipPrecision: Byte;
>     ftAccelerator,
>     ftOverhang: SmallInt;
>   end;

>   PDrawMode = ^TDrawMode;
>   TDrawMode = packed record
>     Rop2,
>     bkMode: SmallInt;
>     bkColor,
>     TextColor: DWORD;
>     TBreakExtra,
>     BreakExtra,
>     BreakErr,
>     BreakRem,
>     BreakCount,
>     CharExtra: SmallInt;
>     LbkColor,
>     LTextColor,
>     ICMCXform: DWORD;
>     StretchBltMode: SmallInt;
>     eMiterLimit: DWORD;
>   end;

>   PFontInfo = ^TFontInfo;
>   TFontInfo = packed record
>     dfType,
>     dfPoints,
>     dfVertRes,
>     dfHorizRes,
>     dfAscent,
>     dfInternalLeading,
>     dfExternalLeading: SmallInt;
>     dfItalic,
>     dfUnderline,
>     dfStrikeOut: Byte;
>     dfWeight: SmallInt;
>     dfCharSet: Byte;
>     dfPixWidth,
>     dfPixHeight: SmallInt;
>     dfPitchAndFamily: Byte;
>     dfAvgWidth,
>     dfMaxWidth: Smallint;
>     dfFirstChar,
>     dfLastChar,
>     dfDefaultChar,
>     dfBreakChar: Byte;
>     dfWidthBytes: SmallInt;
>     dfDevice,
>     dfFace,
>     dfBitsPointer,
>     dfBitsOffset: DWORD;
>     dfReserved: Byte;
>     dfFlags: Longint;                    {Windows 3.x fonts only}
>     dfAspace,                            {Windows 3.x fonts only}
>     dfBspace,                            {Windows 3.x fonts only}
>     dfCspace: SmallInt;                  {Windows 3.x fonts only}
>     dfColorPointer: Longint;             {4 bytes specifying the offset to
the
> color table for
>                                           color fonts, if any. The format
of the
> bits is similar
>                                           to a DIB, but without the
header. That
> is, the
>                                           characters are not split up into
> disjoint bytes.
>                                           Instead, they are left intact.
If no
> color table is
>                                           needed, this entry is NULL.
>                                           [NOTE: This information is
different
> from that in the
>                                           hard-copy Developer's Notes and
> reflects a correction.]}
>     dfReserved1: array[0..3] of Longint; {reserved; do not use.}
>     dfCharTable: record end;             {This is an array of structures
which
> depend very much on the type of the font.
>                                           Four cases are possible:
>                                             - raster fonts: (
>                                               * Windows 2.x fonts:
> TGlyphEntryFakeName
>                                               * Windows 3.0 fonts:
> TRasterGlyphEntry
>                                             - vector fonts:
>                                               * fixed pitched:
> TVectorFixedGlyphEntry
>                                               * variable pitched fonts:
> TVectorGlyphEntry

>                                           This array contains
(dfLastChar -
> dfFirstChar) + 2 entries (one dummy at the end)
>                                           and is indexed by the character
in
> question minus dfFirstChar.

>                                           Windows 2.x fonts are no longer
used.
> Actually for Win2.x fonts dfCharTable would
>                                           start immediately
afterdfReserved.

>                                           Raster fonts are indicated by a
> cleared LSB in dfType else it is a vector font.
>                                           Variable pitch is indicated by a
set
> LSB in dfPitchAndFamily else it is a
>                                           fixed pitched font.
>                                          }
>   end;

>   TGlyphEntryFakeName = packed record  {for raster fonts only, Win2.x
style}
>     CharWidth,
>     Offset: Word;
>   end;

>   TRasterGlyphEntry = packed record  {for variable-pitch raster fonts only
(use
> dfPixWidth for fixed pitch fonts)}
>     {geWidth: Word;}  {ml: it looks like there's no width entry at all}
>     geOffset: Word;
>   end;
>   PRasterGlyphArray = ^TRasterGlyphArray;
>   TRasterGlyphArray = array[0..0] of TRasterGlyphEntry;

>   TVectorFixedGlyphEntry = record    {for fixed pitched vector fonts only,
use
> dfPixWidth for width calculation}
>     Offset: Word;
>   end;

>   TVectorGlyphEntry = record         {for variable pitched vector fonts
only}
>     vgeOffset,
>     vgeWidth: SmallInt;
>   end;
>   PVectorGlyphArray = ^TVectorGlyphArray;
>   TVectorGlyphArray = array[0..0] of TVectorGlyphEntry;

>   {this structure is alternatively used instead of TFontInfo if marked in
> uOptions by ETO_BYTE_PACKED or ETO_BIT_PACKED}
>   PNewFontSeg = ^TNewFontSeg;
>   TNewFontSeg = packed record
>     nfVersion,                           {for Win95 always $0400}
>     nfFormat,                            {see NF_xxx flags}
>     nfNumGlyphs: Word;
>     nfGlyphOffset,
>     nfAWTable: DWORD;
>     nfHeight,
>     nfAscent: Word;
>     nfUniqueID: DWORD;
>   end;

>   PPDevice = ^TPDevice;
>   TPDevice = packed record
>     pdType:

...

read more »

Other Threads