ArcObjects Library Reference (Display)  

IDisplay.hDC Property

The device context that the display is currently drawing to. Only valid between calls to StartDrawing and FinishDrawing.

[Visual Basic .NET]
Public ReadOnly Property hDC As Integer
[C#]
public int hDC {get;}
[C++]
HRESULT get_hDC(
  long* hDC
);
[C++]

Parameters

hDC [out, retval]   hDC is a parameter of type long

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Returns the device context specified to StartDrawing.  This may be the device context of a display, cache (bitmap), or some other device such as a printer.  As StartDrawing is called frequently throughout the drawing pipeline, the hDc property continually changes and is therefore safe to use only within a single StartDrawing / FinishDrawing block.

This property does not provide a value to pass to IDisplay::StartDrawing. Instead, call IDisplay::StartDrawing with a value of 0 for the hDC as this will automatically use the Windows API function GetDC to populate IScreenDisplay::WindowDC with the hDC of the main display and drawing will occur there.

See Also

IDisplay Interface