Maybe I do not understand your situation correctly, but I guess that onDropFiles is used if you drop a file on your running application.
Double-clicking a filename, associated with your app, wil open the app with the filename in ParamStr(1) (at least on windows platform).
Bart
No, the double-clicked file's name is not passed via command line with OS X.
The form's OnDropFile event works fine.
To handle double-clicked files in a cross-platform way:
- In startup code:
{$IFNDEF DARWIN}
if ParamStr(1) <> '' then
do something with ParamStr(1)
{$ENDIF}
- If you want to ensure that drop files only used on OS X:
{$IFDEF DARWIN}
procedure TMainForm.DropFiles( Sender : TObject;
const FileNames : array of string);
begin
if High(FileNames) >= 0 then {At least one file passed?}
do something with FileNames[0]
end;
{$ENDIF}
Thanks.
-Phil