Hello,
When I was using IE 8.6.0 the following code was working fine:
procedure TfrmMain.DropFiles(Sender: TObject; ssFiles: TStrings;
dwEffect: Integer);
{ Add the dropped image files to ImageEnMView }
var
i: Integer;
iFileCount: Integer;
iDroppedFileName: string;
iDroppedFilePath: string;
iFileName: string;
iFrameCount: Integer;
iIndex: Integer;
begin
iFileCount := ssFiles.Count;
if iFileCount = 1 then
begin { Single file dropped }
iDroppedFileName := Trim(ssFiles.GetText);
iDroppedFilePath := ExtractFileDir(iDroppedFileName);
if FileExists(iDroppedFileName) then
begin
iFrameCount := IEGetFileFramesCount(iDroppedFileName);
if iFrameCount = 0 then
begin
MessageBox(0,
'The dropped file does not contain a supported image type.',
'No Supported Image Types', MB_ICONWARNING or MB_OK);
exit;
end
else if iFrameCount = 1 then
begin
{ Single frame file }
iFileName := ExtractFileName(iDroppedFileName);
iIndex := iemPhotos.AppendImage(iDroppedFileName);
if iemPhotos.MIO.Aborting then
begin
MessageBox(0,
'There was an error opening the dropped image. ImageEn can not open the image.',
'Error Opening Image', MB_ICONWARNING or MB_OK);
exit;
end
else
begin
iemPhotos.ImageBottomText[iIndex] := iFileName;
iemPhotos.ImageInfoText[iIndex] :=
IntToStr(iemPhotos.MIO.Params[iIndex].Width) + ' x ' +
IntToStr(iemPhotos.MIO.Params[iIndex].Height);
iemPhotos.SelectedImage := iemPhotos.ImageCount - 1; // iIndex;
end;
end;
end;
end
else { Multiple files dropped }
begin
try
Screen.Cursor := crHourGlass;
for i := 0 to iFileCount - 1 do
begin
{ Get filenames dropped }
iDroppedFileName := Trim(ssFiles[i]);
iDroppedFilePath := ExtractFileDir(iDroppedFileName);
iemPhotos.InsertImage(i, iDroppedFileName);
if iemPhotos.MIO.Aborting then
begin
MessageBox(0,
'There was an error opening the dropped image. ImageEn can not open the image.',
'Error Opening Image', MB_ICONWARNING or MB_OK);
exit;
end
else
begin
iemPhotos.ImageBottomText[i] := ExtractFileName(iDroppedFileName);
iemPhotos.ImageInfoText[i] := IntToStr(iemPhotos.MIO.Params[i].Width)
+ ' x ' + IntToStr(iemPhotos.MIO.Params[i].Height);
end;
end;
iemPhotos.SelectedImage := 0;
finally
Screen.Cursor := crDefault;
end;
end;
end;
procedure TfrmMain.FormCreate(Sender: TObject);
begin
iemPhotos.LookAhead := 500;
iemPhotos.MaintainInvisibleImages := -1;
iemPhotos.ShowText := True;
iemPhotos.EnableAdjustOrientation := True;
{ Create a TIEFileDragDrop class }
AFileDrop := TIEFileDragDrop.Create(iemPhotos, DropFiles);
{ Do not explicity free the FileDrop object }
RegisterExpectedMemoryLeak(AFileDrop);
{ Activate dropping }
AFileDrop.ActivateDropping := True;
end;
But in newer version this code is not working.
I also tried to use the component - TIEFileDragDrop but and still not able to receive any dropped files.
What to do?
TIA
Yogi Yang