CPen::GetLogPen

Gets a LOGPEN underlying structure.

int GetLogPen(
   LOGPEN* pLogPen 
);

Parameters

  • pLogPen
    Points to a LOGPEN structure to contain information about the pen.

Return Value

Nonzero if successful; otherwise 0.

Remarks

The LOGPEN structure defines the style, color, and pattern of a pen.

For example, call GetLogPen to match the particular style of pen.

See the following topics in the Windows SDK for information about pen attributes:

Example

The following code example demonstrates calling GetLogPen to retrieve a pen character, and then create a new, solid pen with the same color.

LOGPEN logpen;
penExisting.GetLogPen(&logpen);
CPen penOther(PS_SOLID, 0, logpen.lopnColor); 

Requirements

Header: afxwin.h

See Also

Reference

CPen Class

Hierarchy Chart

CPen::GetExtLogPen

Other Resources

CPen Members