For Programmers: Free Programming Magazines  


Home > Archive > Delphi > March 2004 > Dropping files onto richedit control (DELPHI 2)?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Dropping files onto richedit control (DELPHI 2)?
Dos-Man

2004-03-27, 12:21 am

Does anyone have experience with writing DELPHI 2 apps
that allow users to drop files onto the richedit control, intercepting
the drop, and opening the file?

I can do this in VB. My knowledge of DELPHI is improving but not
quite as good.

dos-man

________________________________________
_______________________________________

Author of PSassano's Legacy Pad text editor
Jamie

2004-03-27, 12:21 am

i will give you a quick run down.
in the Win32 help.
DrayAcceptFiles is used to register what window will be able
to accept a list of strings dropped onto it.
when the action takes place the window will receive the
WM_DROPFILES, in this message is the Handle to a block of strings.
you use the DragQueryFile to obtain one of the items in thelist.
when completed, you use the DrayFinish to release the handle the
windows message pass to your window handler.
now of course you will need either subclass a TRichEdit or
hook into its WndProc to capture this message.

Dos-Man wrote:
> Does anyone have experience with writing DELPHI 2 apps
> that allow users to drop files onto the richedit control, intercepting
> the drop, and opening the file?
>
> I can do this in VB. My knowledge of DELPHI is improving but not
> quite as good.
>
> dos-man
>
> ________________________________________
_______________________________________
>
> Author of PSassano's Legacy Pad text editor


Dos-Man

2004-03-27, 12:21 am

Jamie < jamie_5_not_valid_after_5_Please@charter
.net> wrote in message news:<104b09s4gln2gb4@corp.supernews.com>...
> i will give you a quick run down.
> in the Win32 help.
> DrayAcceptFiles is used to register what window will be able
> to accept a list of strings dropped onto it.


I got this far. When I drop the file onto the Richedit control
the mouse cursor turns into a + sign. But when I release the
mouse, nothing happens.

> when the action takes place the window will receive the
> WM_DROPFILES,


I'm struggling to handle this message. I only have 2 Delphi
books to refer to!

> in this message is the Handle to a block of strings.
> you use the DragQueryFile to obtain one of the items in thelist.
> when completed, you use the DrayFinish to release the handle the
> windows message pass to your window handler.
> now of course you will need either subclass a TRichEdit or
> hook into its WndProc to capture this message.


I will try to hook into its WndProc. Thank you for helping.

Dos-man
________________________________________
_______________________________________

Author of PSassano's Legacy Pad text editor
Quivis

2004-03-27, 12:21 am

In article <e4bc58ab.0403030820.3e81c808@posting.google.com>,
ChairShot@mail.com says...

8>< /snip

>
> I will try to hook into its WndProc. Thank you for helping.


Or you could try here:
http://homepages.borland.com/torry/draganddrop.htm#1363


Q.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com