User32GetWindowDC(IntPtr) Method
Retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars.
A window device context permits painting anywhere in a window,
because the origin of the device context is the upper-left corner of the window instead of the client area.
GetWindowDC(IntPtr) assigns default attributes to the window device context
each time it retrieves the device context. Previous attributes are lost.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static IntPtr GetWindowDC(
IntPtr hWnd
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function GetWindowDC (
hWnd As IntPtr
) As IntPtr
Dim hWnd As IntPtr
Dim returnValue As IntPtr
returnValue = User32.GetWindowDC(hWnd)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static IntPtr GetWindowDC(
IntPtr hWnd
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member GetWindowDC :
hWnd : IntPtr -> IntPtr
No code example is currently available or this language may not be supported.
- hWnd IntPtr
-
A handle to the window with a device context that is to be retrieved.
If this value is Zero,
GetWindowDC(IntPtr) retrieves the device context for the entire screen of the primary display monitor.
To get the device context for other display monitors,
use the EnumDisplayMonitors(IntPtr, IntPtr, DelegatesEnumMonitorProc, IntPtr) and CreateDC(String, String, String, IntPtr) functions.
IntPtr
If the function succeeds, the return value is a handle to a device context for the specified window.
If the function fails, the return value is
Zero,
indicating an error or an invalid
hWnd parameter.