wideman-one 
Last edit: 05-03-17 Graham Wideman

Delphi

Using GWDropDemo
Article created: 98-06-26

Introduction

GWDropDemo is an application that shows

Quick-start

GWDropDemo_User01.GIF (27719 bytes)

In the example above, some text was selected in MS Word, and dragged and dropped onto the "Drop Zone". You can see that Word can supply data in a variety of different formats, and the Data area shows the actual data in UNICODE format.

More Detailed Examination of IDropTarget and Related Delphi Functions

The actual initialization and finalization processes for IDropTarget are subjects of some confusion in published descriptions, so the IDropTarget panel allows playing with this aspect in more detail, if you're interested.  In addition, the Drop Zone area changes its display when dragged over, demo-ing user-interface feedback.  Also while dragging-over, the Key State and Effect areas show ongoing status updates (try holding down Shift, Control or Alt keys).

GWDropDemo_User02b.gif (12696 bytes)

"Safety of Test" feature: Under normal conditions, many drop-target apps will accept a "MOVE" action -- after which the source app may delete the MOVEd object. Since this app is used for testing, I chose to default to not accepting MOVEs so as to avoid accidentally deleting things during periods of low blood sugar.  To override this safety feature, select "Normal".

Options Menu

There is an option to demo temporarily disabling drop-acceptance. The IDropTarget stays alive, but refuses all drops.

Tests Menu

IDropTarget.AddRef, IDropTarget.Release:  These two tests allow you to observe the effect on RefCount, and (hopefully) convince yourself that we never need to do this.

Delphi Ref: Allows you to add and remove a Delphi (non-COM) reference to the IDropTarget object, demonstrating that this does nothing useful (and has no impact on RefCount).


Go to:  [Drag and Drop Intro Page], or  wideman-one