DrvSetPixelFormat function (winddi.h)

The DrvSetPixelFormat function sets the pixel format of a window.

Syntax

BOOL DrvSetPixelFormat(
  SURFOBJ *pso,
  LONG    iPixelFormat,
  HWND    hwnd
);

Parameters

pso

Pointer to the SURFOBJ structure with which the window is associated.

iPixelFormat

Index that specifies the device format to which the pixel format is to be set. The pixel formats that a device supports are identified by positive one-based integer indices starting at 1.

hwnd

Handle to the window whose pixel format is to be set.

Return value

The return value is TRUE if the function is successful. Otherwise, it is FALSE, and an error code is logged.

Remarks

Setting the pixel format more than once can result in complications for Window Manager and for multithreaded applications. Consequently, the pixel format of a window can be set only once and must remain unchanged.

Requirements

Requirement Value
Target Platform Desktop
Header winddi.h (include Winddi.h)

See also

DrvDescribePixelFormat

SURFOBJ