The ReleaseDC function releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs.
<DllImport(EntryPoint:="ReleaseDC", CharSet:=CharSet.None, SetLastError:=False, ExactSpelling:=False, PreserveSig:=True, CallingConvention:=CallingConvention.StdCall, BestFitMapping:=False, ThrowOnUnmappableChar:=False, Value:="user32.dll")> _
Public Shared Sub ReleaseDC( _
[DllImport(EntryPoint="ReleaseDC", CharSet=CharSet.None, SetLastError=False, ExactSpelling=False, PreserveSig=True, CallingConvention=CallingConvention.StdCall, BestFitMapping=False, ThrowOnUnmappableChar=False, Value="user32.dll")]
public static bool
ReleaseDC( IntPtr windowHandle
, IntPtr deviceContext
Handle to the window whose DC is to be released.
Handle to the DC to be released.
The return value indicates whether the DC was released. If the DC was released, the return value is true.
If the DC was not released, the return value is false.
The application must call the ReleaseDC function for each call to the each call to the GetDC function that retrieves a common DC.
FeaturesW32 Class | Drawing3d.OS.Windows Namespace | GetDC