16
Programming / WPS dragged object handle
« on: September 29, 2023, 12:18:52 am »
When you drag a WPS object (or anything actually) a _DRAGITEM is created to store data about the item being dragged, the structure of DRAGITEM shown below
-------------------------------
typedef struct _DRAGITEM {
HWND hwndItem; /* Window handle of the source of the drag operation. */
ULONG ulItemID; /* Information used by the source to identify the object being dragged. */
HSTR hstrType; /* String handle of the object type. */
HSTR hstrRMF; /* String handle of the rendering mechanism and format. */
HSTR hstrContainerName; /* String handle of the name of the container holding the source object. */
HSTR hstrSourceName; /* String handle of the name of the source object. */
HSTR hstrTargetName; /* String handle of the suggested name of the object at the target. */
SHORT cxOffset; /* X-offset from the pointer hot spot to the origin of the image that represents this object. */
SHORT cyOffset; /* Y-offset from the pointer hot spot to the origin of the image that represents this object. */
USHORT fsControl; /* Source-object control flags. */
USHORT fsSupportedOps; /* Direct manipulation operations supported by the source object. */
} DRAGITEM;
--------------------------------
I am trying to identify the object that is being dragged over my window - either the class of the object or the specific object itself. Is there someway of translating the hwndItem or ulItemID value into a WPS object handle? I am hoping to avoid searching the source container for the source name in order to find the object being dragged.
There is a value in ulItemID, put there either by the WPS or xWorkplaceShell when a WPProgram type object is being dragged. Anyone know what that value is?
I only want to accept dragged WPObjects of a certain type being dropped, and disallow everything else.
Thanks in advance
-------------------------------
typedef struct _DRAGITEM {
HWND hwndItem; /* Window handle of the source of the drag operation. */
ULONG ulItemID; /* Information used by the source to identify the object being dragged. */
HSTR hstrType; /* String handle of the object type. */
HSTR hstrRMF; /* String handle of the rendering mechanism and format. */
HSTR hstrContainerName; /* String handle of the name of the container holding the source object. */
HSTR hstrSourceName; /* String handle of the name of the source object. */
HSTR hstrTargetName; /* String handle of the suggested name of the object at the target. */
SHORT cxOffset; /* X-offset from the pointer hot spot to the origin of the image that represents this object. */
SHORT cyOffset; /* Y-offset from the pointer hot spot to the origin of the image that represents this object. */
USHORT fsControl; /* Source-object control flags. */
USHORT fsSupportedOps; /* Direct manipulation operations supported by the source object. */
} DRAGITEM;
--------------------------------
I am trying to identify the object that is being dragged over my window - either the class of the object or the specific object itself. Is there someway of translating the hwndItem or ulItemID value into a WPS object handle? I am hoping to avoid searching the source container for the source name in order to find the object being dragged.
There is a value in ulItemID, put there either by the WPS or xWorkplaceShell when a WPProgram type object is being dragged. Anyone know what that value is?
I only want to accept dragged WPObjects of a certain type being dropped, and disallow everything else.
Thanks in advance