Jump to content

WinBeginPaint: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
=== Syntax ===
=== Syntax ===
  hps = WinBeginPaint( ''hwnd'',  
  hps = WinBeginPaint( ''hwnd'',  
                       ''hps'',
                       ''hps'',
                       ''prcl'' );
                       ''prcl'' );


=== Parameters ===
=== Parameters ===
HWND ''hwnd'' (input)
;HWND ''hwnd'' (input)
 
:A window handle to where the drawing is going to occur.
A window handle to where the drawing is going to occur.
;HPS ''hps'' (input)
 
:A handle to presentation space.
HPS ''hps'' (input)
;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).
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 ===
=== Returns ===
  HPS hps
HPS hps
 
Handle to the newly created presentation space. NULLHANDLE is returned if there was an error. WinGetLastError will return one of:
Handle to the newly created presentation space. NULLHANDLE is returned if there was an error. WinGetLastError will return one of:
{|class="wikitable"
         
{| border="1"
|-
|0x1001
|0x1001
|PMERR_INVALID_HWND
|PMERR_INVALID_HWND
Line 34: Line 21:
|0x207F
|0x207F
|PMERR_INV_HPS
|PMERR_INV_HPS
|}
|}
 
=== Include Info ===
=== Include Info ===
  #define INCL_WINWINDOWMGR
  #define INCL_WINWINDOWMGR
  #include <os2.h>
  #include <os2.h>
 


=== Usage Explanation ===
=== Usage Explanation ===
 
This function is called (normally in a WM_PAINT message) to obtain presentation space for drawing in a specified window.
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 ===
=== Sample Code ===
Line 55: Line 34:
#define INCL_WINWINDOWMGR
#define INCL_WINWINDOWMGR
#include  
#include  
   .
   .
   .
   .
Line 73: Line 51:
   .
   .
</pre>
</pre>
 
=== See Also ===
=== See Also ===
[[OS2 API:PMI:WinEndPaint|WinEndPaint]],
*[[WinEndPaint]]
[[OS2 API:PMI:WinExcludeUpdateRegion|WinExcludeUpdateRegion]]
*[[WinExcludeUpdateRegion]]
[[OS2 API:PMI:WinGetClipPS|WinGetClipPS]]
*[[WinGetClipPS]]
[[OS2 API:PMI:WinGetPS|WinGetPS]]
*[[WinGetPS]]
[[OS2 API:PMI:WinGetScreenPS|WinGetScreenPS]],
*[[WinGetScreenPS]]
[[OS2 API:PMI:WinInvalidateRect|WinInvalidateRect]],
*[[WinInvalidateRect]]
[[OS2 API:PMI:WinInvalidateRegion|WinInvalidateRegion]],
*[[WinInvalidateRegion]]
[[OS2 API:PMI:WinIsWindowShowing|WinIsWindowShowing]],
*[[WinIsWindowShowing]]
[[OS2 API:PMI:WinIsWindowVisible|WinIsWindowVisible]],
*[[WinIsWindowVisible]]
[[OS2 API:PMI:WinLockVisRegions|WinLockVisRegions]],
*[[WinLockVisRegions]]
[[OS2 API:PMI:WinOpenWindowDC|WinOpenWindowDC]],
*[[WinOpenWindowDC]]
[[OS2 API:PMI:WinQueryUpdateRect|WinQueryUpdateRect]],
*[[WinQueryUpdateRect]]
[[OS2 API:PMI:WinQueryUpdateRegion|WinQueryUpdateRegion]],
*[[WinQueryUpdateRegion]]
[[OS2 API:PMI:WinRealizePalette|WinRealizePalette]],
*[[WinRealizePalette]]
[[OS2 API:PMI:WinReleasePS|WinReleasePS]],
*[[WinReleasePS]]
[[OS2 API:PMI:WinShowWindow|WinShowWindow]],
*[[WinShowWindow]]
[[OS2 API:PMI:WinUpdateWindow|WinUpdateWindow]],
*[[WinUpdateWindow]]
[[OS2 API:PMI:WinValidateRect|WinValidateRect]],
*[[WinValidateRect]]
[[OS2 API:PMI:WinValidateRegion|WinValidateRegion]]
*[[WinValidateRegion]]
 


[[Category:The OS/2 API Project]]
[[Category:Win]]

Revision as of 21:36, 14 December 2016

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.

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