共用方式為


CPalette::FromHandle

Returns a pointer to a CPalette object when given a handle to a Windows palette object.

static CPalette* PASCAL FromHandle(
   HPALETTE hPalette 
);

Parameters

  • hPalette
    A handle to a Windows GDI color palette.

Return Value

A pointer to a CPalette object if successful; otherwise NULL.

Remarks

If a CPalette object is not already attached to the Windows palette, a temporary CPalette object is created and attached. This temporary CPalette object is valid only until the next time the application has idle time in its event loop, at which time all temporary graphic objects are deleted. In other words, the temporary object is valid only during the processing of one window message.

Requirements

Header: afxwin.h

See Also

Concepts

CPalette Class

CPalette Members

Hierarchy Chart