## Callback Functions

This section contains information about the following callback functions used with Active Accessibility.

- DDIHookProc
- WinEventProc

### DDIHookProc

    DWORD CALLBACK DDIHookProc (HDDI hddi, LONG lPrivateData,
        DDITYPE ddiType, LPDDIPARAMS lpDDIStruct);

Application-defined callback function called by GDI when a display device interface (DDI) function is called. This is a function prototype for conceptual presentation; actual callback functions in your code would accept the same parameters and return a DWORD value, but need not have an identical label.

Note: You must write this callback procedure in a 16-bit DLL.

- Returns a DWORD value specific to the DDI call being made. The CallNextDDI function generates this value.

hddi
  Handle to a DDI hook function.
lPrivateData
  A 32-bit value associated with this callback function. You set this value in the previous call to the SetDDIHook function.
ddiType
  DDI function type value identifying the DDI function being called. This parameter can be one of the following values. For information on the functions and structures identified by this parameter, see the Windows 95 Device Driver Kit (DDK).

  Value | Meaning
  DDI_BITBLT | The DDI function being called is BitBlt and the lpDDIStruct parameter specifies the address of a BITBLT_DDIPARAMS structure.
  DDI_BITMAPBITS | The DDI function being called is BitmapBits and lpDDIStruct specifies the address of a BITMAPBITS_DDIPARAMS structure.
  DDI_COLORINFO | The DDI function being called is ColorInfo and lpDDIStruct specifies the address of a COLORINFO_DDIPARAMS structure.
  DDI_CONTROL | The DDI function being called is Control and lpDDIStruct specifies the address of a CONTROL_DDIPARAMS structure.
  DDI_CREATEDIBITMAP | The DDI function being called is CreateDIBitmap and lpDDIStruct specifies the address of a CREATEDIBITMAP_DDIPARAMS structure.
  DDI_DEVICEBITMAP | The DDI function being called is DeviceBitmap and lpDDIStruct specifies the address of a DEVICEBITMAP_DDIPARAMS structure.
  DDI_DEVICEMODE | The DDI function being called is DeviceMode and lpDDIStruct specifies the address of a DEVICEMODE_DDIPARAMS structure.
  DDI_DIBBLT | The DDI function being called is DeviceBitmapBits and lpDDIStruct specifies the address of a DIBBLT_DDIPARAMS structure.
  DDI_DIBTODEVICE | The DDI function being called is SetDIBitsToDevice and lpDDIStruct specifies the address of a DIBTODEVICE_DDIPARAMS structure.
  DDI_DISABLE | The DDI function being called is Disable and lpDDIStruct specifies the address of a DISABLE_DDIPARAMS structure.
  DDI_ENABLE | The DDI function being called is Enable and lpDDIStruct specifies the address of an ENABLE_DDIPARAMS structure.
  DDI_ENUMDEVICEFONTS | The DDI function being called is EnumDFonts and lpDDIStruct specifies the address of an ENUMDEVICEFONTS_DDIPARAMS structure.
  DDI_ENUMOBJECTS | The DDI function being called is EnumObj and lpDDIStruct specifies the address of an ENUMOBJECTS_DDIPARAMS structure.
  DDI_EXTTEXTOUT | The DDI function being called is ExtTextOut and lpDDIStruct specifies the address of an EXTTEXTOUT_DDIPARAMS structure.
  DDI_FASTBORDER | The DDI function being called is FastBorder and lpDDIStruct specifies the address of a FASTBORDER_DDIPARAMS structure.
  DDI_GETCHARWIDTH | The DDI function being called is GetCharWidth and lpDDIStruct specifies the address of a GETCHARWIDTH_DDIPARAMS structure.
  DDI_GETPALETTE | The DDI function being called is GetPalette and lpDDIStruct specifies the address of a GETSETPALETTE_DDIPARAMS structure.
  DDI_GETPALETTETRANSLATE | The DDI function being called is GetPalTrans and lpDDIStruct specifies the address of a GETSETPALETTETRANSLATE_DDIPARAMS structure.
  DDI_OUTPUT | The DDI function being called is Output and lpDDIStruct specifies the address of an OUTPUT_DDIPARAMS structure.
  DDI_PIXEL | The DDI function being called is Pixel and lpDDIStruct specifies the address of a PIXEL_DDIPARAMS structure.
  DDI_REALIZEOBJECT | The DDI function being called is RealizeObject and lpDDIStruct specifies the address of a REALIZEOBJECT_DDIPARAMS structure.
  DDI_SCANLEFTRIGHT | The DDI function being called is ScanLR and lpDDIStruct specifies the address of a SCANLEFTRIGHT_DDIPARAMS structure.
  DDI_SELECTBITMAP | The DDI function being called is SelectBitmap and lpDDIStruct specifies the address of a SELECTBITMAP_DDIPARAMS structure.
  DDI_SETATTRIBUTE | The DDI function being called is SetAttribute and lpDDIStruct specifies the address of a SETATTRIBUTE_DDIPARAMS structure.
  DDI_SETPALETTE | The DDI function being called is SetPalette and lpDDIStruct specifies the address of a GETSETPALETTE_DDIPARAMS structure
  DDI_SETPALETTETRANSLATE | The DDI function being called is SetPalTrans and lpDDIStruct specifies the address of a GETSETPALETTETRANSLATE_DDIPARAMS structure.
  DDI_STRETCHBLT | The DDI function being called is StretchBlt and lpDDIStruct specifies the address of a STRETCHBLT_DDIPARAMS structure.
  DDI_STRETCHDIBITS | The DDI function being called is StretchDIBits and lpDDIStruct specifies the address of a STRETCHDIBITS_DDIPARAMS structure.
  DDI_STRINGBLT | The DDI function being called is StrBlt and lpDDIStruct specifies the address of a STRINGBLT_DDIPARAMS structure.
  DDI_UPDATECOLORS | The DDI function being called is UpdateColors and lpDDIStruct specifies the address of an UPDATECOLORS_DDIPARAMS structure.

lpDDIStruct
  Address of a DDI stack function structure, as defined in the winddi.h header file. This address exists within the stack; the structure is provided to allow applications to easily modify values if needed.

### WinEventProc

    VOID CALLBACK WinEventProc(HWINEVENTHOOK hWinEventHook,
        DWORD event, HWND hwnd, LONG idObject, LONG idChild,
        DWORD dwEventThread, DWORD dwmsEventTime);

Application-defined callback function called by USER in response to events generated by an accessible object. This is a function prototype for conceptual presentation; actual callback functions in your code would accept the same parameters and return a VOID, but need not have an identical label.

hWinEventHook
  Handle to an event hook. This value is specific to each instance of a WinEventProc function.
event
  Value specifying the event that occurred. This value will be one of the event constants.
hwnd
  Handle to the window generating the event, or NULL if no window is associated with the event.
idObject
  Value identifying the top-level object associated with the event. This will be one of the object identifier constants or a custom object ID. If this value is OBJID_WINDOW, then the object is the window itself.
idChild
  ID of the child element triggering the event, or CHILDID_SELF if the event is for the object itself.
dwEventThread
  ID of the thread generating the event. This value is provided for background information only.
dwmsEventTime
  Value specifying the time of the event, in milliseconds.

An Active Accessibility client requests specific types of event notifications by calling the SetWinEventHook function.

You can create multiple callback functions to handle different events. For more information, see About the WinEventProc Callback Function.

See also WINEVENTPROC, SetWinEventHook

© 1997 Microsoft Corporation. All rights reserved. Legal Notices.