Board index » delphi » Quasi-beginner question (drag'n'drop)

Quasi-beginner question (drag'n'drop)

        I worked apx. 2 hours to find out how to make Delphi program (resp. part
of a form) to accept file dragged from Windows Explorer in W95, but found
nothing. No sign of changing the cursor or starting any od drag-drop
oriented events. Ideas very appreciated, thanx a lot.
                                                                HERBY

 

Re:Quasi-beginner question (drag'n'drop)


From the WinApi.Hlp file:
-------------------------

procedure DragAcceptFiles(Wnd: HWnd; Accept: Bool);

The DragAcceptFiles function registers whether a given window accepts
dropped files.

Parameter       Description

Wnd     Identifies the window registering whether it accepts dropped files.
Accept  Specifies whether the window specified by the Wnd parameter
accepts dropped files. An application should set this value to TRUE to
accept dropped files or FALSE to discontinue accepting dropped files.

Returns

Does not return a value.

Comments

When an application calls DragAcceptFiles with Accept set to TRUE,
Windows File Manager (WINFILE.EXE) sends the specified window a
WM_DROPFILES message each time the user drops a file in that window.

See Also

WM_DROPFILES
Drag-drop functions (3.1)

--------------------------

You will also have to handle WM_DROPFILES. If you know how to intercept
windows messages you should be on the right track with this.

-- Jan Holst

Quote
Herby Vojcik wrote:

>         I worked apx. 2 hours to find out how to make Delphi program (resp. part
> of a form) to accept file dragged from Windows Explorer in W95, but found
> nothing. No sign of changing the cursor or starting any od drag-drop
> oriented events. Ideas very appreciated, thanx a lot.
>                                                                 HERBY

Re:Quasi-beginner question (drag'n'drop)


Jan Holst Jensen <j...@novo.dk> wrote in article <32A445FB.4...@novo.dk>...

Quote
> From the WinApi.Hlp file:
> -------------------------

> procedure DragAcceptFiles(Wnd: HWnd; Accept: Bool);
> ... etc ...
> --------------------------

> You will also have to handle WM_DROPFILES. If you know how to intercept
> windows messages you should be on the right track with this.

> -- Jan Holst

> Herby Vojcik wrote:

> >         I worked apx. 2 hours to find out how to make Delphi program
(resp. part
> > of a form) to accept file dragged from Windows Explorer in W95, but
found
> > nothing. No sign of changing the cursor or starting any od drag-drop
> > oriented events. Ideas very appreciated, thanx a lot.
> >                                                                 HERBY

I meant, if this thing isn't somehow built-in. Intercepting low-level
system message and playing with hooks is the way, but not so OO and visual
.. Is this the only posiible way in Delphi? (but thanx anyway)
                                                                HERBY

Re:Quasi-beginner question (drag'n'drop)


On 3 Dec 1996 21:13:50 GMT, "Herby Vojcik" <he...@kolej.mff.cuni.cz> wrote:

Quote
>> >         I worked apx. 2 hours to find out how to make Delphi program
>(resp. part
>> > of a form) to accept file dragged from Windows Explorer in W95, but
>found
>> > nothing. No sign of changing the cursor or starting any od drag-drop
>> > oriented events. Ideas very appreciated, thanx a lot.
>> >                                                                 HERBY

>I meant, if this thing isn't somehow built-in. Intercepting low-level
>system message and playing with hooks is the way, but not so OO and visual
>.. Is this the only posiible way in Delphi? (but thanx anyway)

Look for the TFileDrag component by Erik C. Nielsen. It makes this as easy as
it can get.

     Rogier Meurs  -  0meur...@lelystad.flnet.nl

        Visit the RogSoft NotePad+ HomePage!
 NotePad+ is the Free Win95 Notepad replacement that
          eats standard Notepad for lunch!
        http://lelystad.flnet.nl/~0meurs01/

Other Threads