大网数据广告活动
Windows 系统接口

DROPEFFECT Constants (OleIdl.h)

· 52CE 我爱测

Represents information about the effects of a drag-and-drop operation.

Represents information about the effects of a drag-and-drop operation. The DoDragDrop function and many of the methods in the IDropSource and IDropTarget use the values of this enumeration.

Constant/value Description
DROPEFFECT_NONE 0 Drop target cannot accept the data.
DROPEFFECT_COPY 1 Drop results in a copy. The original data is untouched by the drag source.
DROPEFFECT_MOVE 2 Drag source should remove the data.
DROPEFFECT_LINK 4 Drag source should create a link to the original data.
DROPEFFECT_SCROLL 0x80000000 Scrolling is about to start or is currently occurring in the target. This value is used in addition to the other values.

Remarks

Your application should always mask values from the DROPEFFECT enumeration to ensure compatibility with future implementations. Presently, only some of the positions in a DROPEFFECT value have meaning. In the future, more interpretations for the bits will be added. Drag sources and drop targets should carefully mask these values appropriately before comparing. They should never compare a DROPEFFECT against, say, DROPEFFECT_COPY by doing the following:

if (dwDropEffect == DROPEFFECT_COPY)... 

Instead, the application should always mask for the value or values being sought as using one of the following techniques:

if (dwDropEffect & DROPEFFECT_COPY) == DROPEFFECT_COPY)...

if (dwDropEffect & DROPEFFECT_COPY)... 

This allows for the definition of new drop effects, while preserving backward compatibility with existing code.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header OleIdl.h

See also

DoDragDrop

IDropSource

IDropTarget

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。