Function Reference


_WinAPI_GetDC

Retrieves a handle of a display device context for the client area a window

#include <WinAPI.au3>
_WinAPI_GetDC ( $hWnd )

Parameters

$hWnd Handle of window

Return Value

Success: The device context for the given window's client area
Failure: 0

Remarks

After painting with a common device context, the _WinAPI_ReleaseDC() function must be called to release the DC

Related

_WinAPI_DeleteDC, _WinAPI_ReleaseDC

See Also

Search GetDC in MSDN Library.

Example

#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    Local $hWnd, $hDC
    $hWnd = GUICreate("test")
    $hDC = _WinAPI_GetDC($hWnd)
    MsgBox($MB_SYSTEMMODAL, "Handle", "Display Device: " & $hDC)
    _WinAPI_ReleaseDC($hWnd, $hDC)
EndFunc   ;==>Example