Enable


WORD Enable(LPVOID lpDevInfo, WORD wAction, LPSTR lpDestDevType,
    LPSTR lpOutputFile, LPVOID lpData);

Initializes software and hardware for the specified driver. Every graphics driver must export an Enable function.

lpDevInfo

Address of a PDEVICE or GDIINFO structure depending on the value of the wAction parameter.

wAction

The initialization action. Can be one of these values:

0x0000

Initializes the driver and associated hardware and then copies device-specific information needed by the driver to the PDEVICE structure pointed to by lpDevInfo.

0x0001

Copies the device driver information to the GDIINFO structure pointed to by lpDevInfo.

0x8000

Initializes the PDEVICE structure pointed to by lpDevInfo, but does not initialize the driver and peripheral hardware.

0x8001

Same as 0x0001.


GDI sets the high order bit of wAction only if an application has requested an information context.

lpDestDevType

Address of a string that specifies the device name. This string applies only to device drivers that support more than one model of the same device. This parameter can be NULL if only one model is supported.

lpOutputFile

Address of a string that specifies the name of the output port or file to receive output from the driver. The string must be a valid MS-DOS filename. This parameter must be NULL for the display.

lpData

Address of DEVMODE structure that contains information Enable uses to initialize the device. This parameter must be NULL for the display.

The export ordinal for this function is 5.

In some cases, GDI may request a raster device to write to a memory bitmap without enabling the device first. This occurs only with raster devices that can write to memory bitmaps.

GDI calls this function when it creates a device or information context for an application, or when it restores the context after Windows returns from a full-screen application.

For most devices, GDI calls Enable twice: first, to retrieve the driver's GDIINFO structure, and second, then to initialize the device and the PDEVICE structure.

See also DEVMODE, Disable, GDIINFO, PDEVICE