Jump to content

WinBeginPaint

From EDM2
Revision as of 17:34, 17 May 2016 by Martini (talk | contribs) (Created page with "=== Syntax === hps = WinBeginPaint( ''hwnd'', ''hps'', ''prcl'' ); === Parameters === HWND ''hwnd'' (input) A window handle t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Syntax

hps = WinBeginPaint( hwnd, 
                     hps,
                     prcl );


Parameters

HWND hwnd (input)

A window handle to where the drawing is going to occur.

HPS hps (input)

A handle to presentation space.

PRECTL prcl (input)

A pointer to the bounding rectangle. The value must be in the range of -32,767 through 32,767. A NULL value indicates no bounding rectangle (the whole window will be painted).


Returns

 HPS hps

Handle to the newly created presentation space. NULLHANDLE is returned if there was an error. WinGetLastError will return one of:

0x1001 PMERR_INVALID_HWND
0x207F PMERR_INV_HPS

Include Info

#define INCL_WINWINDOWMGR
#include <os2.h>


Usage Explanation

This function is called (normally in a WM_PAINT message) to obtain presentation space for drawing in a specified window.


Relevant Structures

Gotchas

Sample Code

 
#define INCL_WINWINDOWMGR
#include 

   .
   .
   .
case WM_PAINT:
    hps = WinBeginPaint(hwnd, NULLHANDLE, NULL);

    WinQueryWindowRect(hwnd, &rcl);

    WinDrawText(hps, -1, "Hello World", &rcl, CLR_NEUTRAL, CLR_BACKGROUND,
                DT_CENTER | DT_VCENTER | DT_ERASERECT);

    WinEndPaint(hps);
    return 0;
   .
   .
   .

See Also

PMI:WinEndPaint, PMI:WinExcludeUpdateRegion, PMI:WinGetClipPS, PMI:WinGetPS, PMI:WinGetScreenPS, PMI:WinInvalidateRect, PMI:WinInvalidateRegion, PMI:WinIsWindowShowing, PMI:WinIsWindowVisible, PMI:WinLockVisRegions, PMI:WinOpenWindowDC, PMI:WinQueryUpdateRect, PMI:WinQueryUpdateRegion, PMI:WinRealizePalette, PMI:WinReleasePS, PMI:WinShowWindow, PMI:WinUpdateWindow, PMI:WinValidateRect, PMI:WinValidateRegion