Jump to content

DrgReleasePS

From EDM2
Revision as of 05:05, 8 April 2025 by Iturbide (talk | contribs) (Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function releases a presentation space obtained by using the DrgGetPS function.

Syntax

DrgReleasePS(hps)

Parameters

hps (HPS) - input
Handle of the presentation space to release.

Returns

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

Remarks

Only presentation spaces created with DrgGetPS can be released using this function. The presentation-space handle should not be used after this function.

Errors

Possible returns from WinGetLastError:

PMERR_INV_HPS (0x207F)
An invalid presentation-space handle was specified.
PMERR_NOT_DRAGGING (0x1f00)
A drag operation is not in progress at this time.

Example Code

In this example the presentation space handle is retrieved, a bit map is loaded, and the presentation space is released with the DrgReleasePS function.

#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */
#include <os2.h>
#define ID_BITMAP 255

HPS  hps;
HWND hwnd;

case DM_DRAGOVER:
   hps = DrgGetPS(hwnd);
   DrawTargetEmphasis(hps, hwnd);
   DrgReleasePS(hps);

Related Functions