win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinReleasePS (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINWINDOWMGR
 
BOOL WinReleasePS(hps)
HPS hps;    /* presentation-space handle */
 
The WinReleasePS function releases a cached presentation space obtained by
using the WinGetClipPS, WinGetPS, or WinGetScreenPS function.
 
Only a cached presentation space can be released using this function. The
presentation space is returned to the cache for reuse. The
presentation-space handle should not be used following this function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the cached presentation space to release.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Comments
 
Before an application terminates, it must call WinReleasePS to release any
cached presentation spaces obtained.
 
Example
 
This example processes an application-defined message (IDM_FILL). It calls
WinGetPS to get a presentation space to the entire window. It gets the
dimensions of the current window, fills the window, and calls WinReleasePS
to release the presentation space.
 
case IDM_FILL:
    hps = WinGetPS(hwnd);              /* gets ps for entire window  */
    WinQueryWindowRect(hwnd, &rcl);    /* gets window dimensions     */
    WinFillRect(hps, &rcl, CLR_WHITE); /* clears entire window       */
    WinReleasePS(hps);                 /* releases ps                */
 
See Also
 
WinGetClipPS, WinGetPS, WinGetScreenPS