Copyright: Copyright © 1998 Adeve Software, Dr D.A.Cole


TDropFile component

Methods	Events

TDropFile Copyright 1998 Adeve Software and Dr David A. Cole

Description

The TDropFile component quickly enables you to add dropfile capabilities to your application window. A file may be dragged from file manager, the windows desktop, or any other windows application to your application. If you will need to drag more than one file to your application use the TMultiDropFile component.

Simply drop the TDropfile component onto the application form at design time. To enable drop file capability use the enableDropFile method. To turn off drop file capabilty use the disableDropFileMethod. To capture the droped file information use the onFileDrop event.

The TDropFile component works by subclassing the application window, that you supply the window handle for in the enableDropFile method.


EnableDropFile method

Declaration

procedure EnableDropFile(parHandle: Integer);

Description

The EnableDropFile method puts the window, with a window handle parHandle, into dropfiles mode.


Methods

EnableDropFile

DisableDropFile


DisableDropFile method

Declaration

procedure DisableDropFile;

Description

The DisableDropFile method turns of the DropFile mode. of the window enabled using EnableDropFile.


Events

OnFileDrop


OnFileDrop event

Declaration

TFileDropEvent = procedure(Sender: TObject; Filename: String) of object;

property OnFileDrop: TFileDropEvent;

Description

The OnFileDrop event occurs when the window, activated using the  enableDropFile method, recieves a WM_DROPFILES message indicating that a file has been dragged and dropped onto that window. The event sends the filename of the dropped file.