Jump to content

WinReleasePS

From EDM2
Revision as of 18:44, 14 May 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This method releases a cache presentation space obtained using the WinGetPS, the WinGetScreenPS, or the WinGetClipPS call.

Syntax

WinReleasePS(hps)

Parameters

hps (HPS)
Presentation-space handle

Returns

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion.
FALSE
Error occurred.

Remarks

Only cache presentation spaces can be released using this method, after which the presentation space is returned to the cache to be used again. The presentation-space handle should not be used following this call.

Example Code

Declaration:

#define INCL_WINWINDOWMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
#include <os2.h>

HPS     hps;  /*  Handle of the cache presentation space to release, as returned by the WinGetPS, the WinGetScreenPS, or the WinGetClipPS function. */
BOOL    rc;   /*  Success indicator. */

rc = WinReleasePS(hps);

This example shows how a thread can access a presentation space, draw to it, and release it.

#define INCL_DOSSEMAPHORES
#define INCL_GPIPRIMITIVES
#define INCL_WINWINDOWMGR
#include <OS2.H>
HPS hps;


      hps = WinGetPS( hwndClient );

 /*   Draw client area              */
       .                                                                          */
       .                                                                          */
       .

 /* Release the presentation space  */

      WinReleasePS( hps );

Related Functions