DrgGetPS
Appearance
This function gets a presentation space that is used to provide target feedback to the user during a drag operation.
Syntax
DrgGetPS(hwnd)
Parameters
- hwnd (HWND) - input
- Handle of the window for which presentation space is required.
Returns
- Hps (HPS) - returns
- Presentation-space handle used for drawing in the window.
- NULLHANDLE - Error occurred.
Remarks
This function returns a handle to a presentation space that can be used for drawing while a direct manipulation operation is in progress. DrgGetPS is called only during a direct manipulation operation. This function is called only after a DM_DRAGOVER, DM_DRAGLEAVE, or DM_DROP message has been received. In order to draw target emphasis, an application must use DrgGetPS and DrgReleasePS to unlock its window. The presentation space created with DrgGetPS must be freed with DrgReleasePS.
Errors
Possible returns from WinGetLastError:
- PMERR_INVALID_HWND (0x1001)
- An invalid window handle was specified.
- PMERR_NOT_DRAGGING (0x1f00)
- A drag operation is not in progress at this time.
Example Code
#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */ #include <os2.h> HPS hps; /* Presentation space handle */ HWND hwnd; /* Handle of the window for which */ /* presentation space is required */ case DM_DRAGOVER: hps = DrgGetPS(hwnd); DrawTargetEmphasis(hps, hwnd); DrgReleasePS(hps);