GetStockObject (gdi32)
Last changed: -41.234.163.150

.
Summary

C# Signature:

[DllImport("gdi32.dll")]
static extern IntPtr GetStockObject(int fnObject);

Constants:

private const int WHITE_BRUSH     = 0;
private const int LTGRAY_BRUSH    = 1;
private const int GRAY_BRUSH      = 2;
private const int DKGRAY_BRUSH    = 3;
private const int BLACK_BRUSH     = 4;
private const int NULL_BRUSH      = 5;
private const int HOLLOW_BRUSH    = NULL_BRUSH;
private const int WHITE_PEN       = 6;
private const int BLACK_PEN       = 7;
private const int NULL_PEN        = 8;
private const int OEM_FIXED_FONT      = 10;
private const int ANSI_FIXED_FONT     = 11;
private const int ANSI_VAR_FONT       = 12;
private const int SYSTEM_FONT     = 13;
private const int DEVICE_DEFAULT_FONT = 14;
private const int DEFAULT_PALETTE     = 15;
private const int SYSTEM_FIXED_FONT   = 16;
private const int DEFAULT_GUI_FONT    = 17;
private const int DC_BRUSH        = 18;
private const int DC_PEN          = 19;

User-Defined Types:

public enum StockObjects {

    WHITE_BRUSH     = 0,
    LTGRAY_BRUSH    = 1,
    GRAY_BRUSH      = 2,
    DKGRAY_BRUSH    = 3,
    BLACK_BRUSH     = 4,
    NULL_BRUSH      = 5,
    HOLLOW_BRUSH    = NULL_BRUSH,
    WHITE_PEN       = 6,
    BLACK_PEN       = 7,
    NULL_PEN    = 8,
    OEM_FIXED_FONT  = 10,
    ANSI_FIXED_FONT = 11,
    ANSI_VAR_FONT   = 12,
    SYSTEM_FONT     = 13,
    DEVICE_DEFAULT_FONT = 14,
    DEFAULT_PALETTE     = 15,
    SYSTEM_FIXED_FONT   = 16,
    DEFAULT_GUI_FONT    = 17,
    DC_BRUSH    = 18,
    DC_PEN      = 19,
    }

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation