/// <summary> /// The BeginPaint function prepares the specified window for painting and fills a <see cref="PAINTSTRUCT"/> structure with information about the painting. /// </summary> /// <param name="hwnd">Handle to the window to be repainted.</param> /// <param name="lpPaint">Pointer to the <see cref="PAINTSTRUCT"/> structure that will receive painting information.</param> /// <returns> /// If the function succeeds, the return value is the handle to a display device context for the specified window. /// If the function fails, the return value is <see cref="SafeDCHandle.Null"/>, indicating that no display device context is available..</returns> /// <remarks> /// <para> /// The BeginPaint function automatically sets the clipping region of the device context to exclude any area outside the update region. /// The update region is set by the InvalidateRect or InvalidateRgn function and by the system after sizing, moving, creating, scrolling, /// or any other operation that affects the client area. If the update region is marked for erasing, BeginPaint sends a <see cref="WindowMessage.WM_ERASEBKGND"/> message to the window. /// </para> /// <para> /// An application should not call BeginPaint except in response to a <see cref="WindowMessage.WM_PAINT"/> message. /// Each call to BeginPaint must have a corresponding call to the <see cref="EndPaint(IntPtr, PAINTSTRUCT*)"/> function. /// </para> /// <para> /// If the caret is in the area to be painted, BeginPaint automatically hides the caret to prevent it from being erased. /// If the window's class has a background brush, BeginPaint uses that brush to erase the background of the update region before returning. /// </para> /// </remarks> public static unsafe SafeDCHandle BeginPaint( IntPtr hwnd, [Friendly(FriendlyFlags.Out)] PAINTSTRUCT *lpPaint) { var hdc = BeginPaint_IntPtr(hwnd, lpPaint); return(hdc != IntPtr.Zero ? new SafeDCHandle(hwnd, hdc) : null); }
public static extern unsafe Int32 EndPaint(IntPtr hWnd, PAINTSTRUCT *ps);
public static unsafe extern IntPtr BeginPaint(IntPtr hWnd, PAINTSTRUCT *ps);
private static extern BOOL EndPaint(HWND hWnd, PAINTSTRUCT *lpPaint);
private static extern HDC BeginPaint(HWND hWnd, PAINTSTRUCT *lpPaint);
public unsafe static extern BOOL EndPaint(IntPtr hWnd, PAINTSTRUCT *lpPaint);
public unsafe static partial BOOL EndPaint(IntPtr hWnd, PAINTSTRUCT *lpPaint);