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!