Home Delphi: DragQueryFile and ThunderBird
Reply: 0

Delphi: DragQueryFile and ThunderBird

durumdara Published in 2017-11-09 09:59:03Z

We use this code for get dragged files:

if Msg.Message = WM_DROPFILES then
    for fnum := 0 to DragQueryFile(Msg.WParam, FileIndex, NIL, 255) - 1 do
        DragQueryFile(Msg.WParam, fnum, buffer, 255);
        fname := StrPas(buffer);
    Handled := true;

We use these filenames as links in the database (just the paths, not the content).

It is working with real filenames, the drag is ok.

But now we need to handle the dragged emails from ThunderBird. It's interesting because if anybody drag an email from ThunderBird and drop it into our form, the eml file will become "temporary". The file is created by Thunderbird to "User\Local Settings\Temp" with the email subject and the eml content.

For very short period the file is reachable, existing. I can read it in this procedure, or in the end of the procedure (after the DragFinish).

The file is not really temporary, the Attrs = 32 (and not 256).

I tried to start a millisec long timer to check when removed, but it still exists after messages processed.

But when I try to debug this code, or I push a button for check file existence - it doesn't exist anymore. So it kept for short period by ThunderBird.

So I can't determine it's persistent file, or it will be deleted by the real owner later and I need to copy somewhere to preserve it.

Two points may I have: the eml extension and the local temp directory.

A different solution could be OLE drag, but then I don't know the extension - only the file content.

It would be nicer if I could get the source application's handle or info from the source app to I can determine what to do.

Is there any solution to this problem? Do you know about any function where I can get info from the Dragged files?

Thank you for your help!


You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.31293 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO