ArcObjects Library Reference (Display)  

IScreenDisplay.WindowDC Property

Device context for the associated window. Only use this between calls to StartDrawing and FinishDrawing.

[Visual Basic .NET]
Public ReadOnly Property WindowDC As Integer
[C#]
public int WindowDC {get;}
[C++]
HRESULT get_WindowDC(
  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

This property is a Windows operating environment device context handle. The Windows operating environment manages the system display by assigning a device context for each window in the application. You can use the WindowDC property to refer to the handle for an object's device context.

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.

The value of the WindowDC property can change while an application runs, so do not store the value in a variable; instead, use the WindowDC property each time you need it.

See Also

IScreenDisplay Interface

.NET Related Topics

Display events |