Jump to content

DrgSetDragPointer

From EDM2
Revision as of 05:12, 8 April 2025 by Iturbide (talk | contribs) (Created page with "This function sets the pointer to be used while over the current target. ==Syntax== DrgSetDragPointer(pdinfo, hptr) ==Parameters== ;pdinfo (PDRAGINFO) - input: Pointer to the DRAGINFO structure to be used for this drag. ;hptr (HPOINTER) - input: Handle to the pointer to use. ==Returns== ;rc (BOOL) - returns: Success indicator. :: TRUE - Successful completion. :: FALSE - Error occurred. ==Remarks== This function sets the pointer to be used to indicate the hot spo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function sets the pointer to be used while over the current target.

Syntax

DrgSetDragPointer(pdinfo, hptr)

Parameters

pdinfo (PDRAGINFO) - input
Pointer to the DRAGINFO structure to be used for this drag.
hptr (HPOINTER) - input
Handle to the pointer to use.

Returns

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

Remarks

This function sets the pointer to be used to indicate the hot spot while dragging over the current target. The pointer that is set with DrgSetDragPointer is used only while it is over the current target. The pointer is reset to the default when a new target is dragged over. This function can be used by an application to provide meaningful augmentation emphasis for an operation that is unknown to the system (for example, swap). When the drag pointer is successfully set, TRUE is returned.

Errors

Possible returns from WinGetLastError:

PMERR_INVALID_HPTR (0x101B)
An invalid pointer handle was specified.

Example Code

This example uses the DrgSetDragPointer function to set the image used for the pointer while the pointer is over the target during a direct manipulation operation.

#define INCL_WINSTDDRAG /* Direct Manipulation (Drag) Functions */
#include <OS2.H>

BOOL      flResult;
PDRAGITEM pditem;
HPOINTER  hptrCrossHair;
MPARAM    mp1;
char      szBuffer[32];

case DM_DRAGOVER:
   DrgSetDragPointer ((PDRAGINFO) mp1, hptrCrossHair);

Related Functions