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.
WinGetPS (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINWINDOWMGR
HPS WinGetPS(hwnd)
HWND hwnd; /* handle of the window */
The WinGetPS function retrieves a cache presentation space that is a cache
micro presentation space present in the system. This space can be used for
simple drawing operations that do not depend on long-term data being stored
in the presentation space.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hwnd Identifies the window to retrieve a presentation space for.
Return Value
The return value identifies presentation space that can be used for drawing
in the window.
Comments
The initial state of the presentation space is the same as that of a
presentation space created using the GpiCreatePS function. The color table
is in default color-index mode. The visible region associated with the
presentation space depends on the window and class styles of the window
identified by the hwnd parameter. The visible region can have one of the
following values:
Value Meaning
────────────────────────────────────────────────────────────────────────────
WS_CLIPCHILDREN All the window's child windows are excluded.
WS_CLIPSIBLINGS All the window's sibling windows are excluded.
WS_PARENTCLIP The visible region is the same as that of the window's
parent window.
Note that any presentation spaces created with the WinGetPS function must be
released by calling the WinReleasePS function. This must be done before the
application terminates.
The WinGetPS function should not be called by any thread which does not have
a message queue (see WinCreateMsgQueue).
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); /* get ps for the entire window */
WinQueryWindowRect(hwnd, &rcl); /* get window dimensions */
WinFillRect(hps, &rcl, CLR_WHITE); /* clear entire window */
WinReleasePS(hps); /* release the ps */
return 0L;
See Also
GpiCreatePS, WinCreateMsgQueue, WinGetClipPS, WinGetScreenPS, WinReleasePS
♦