Lazarus

Programming => Widgetset => Win32/64 => Topic started by: jwdietrich on March 16, 2016, 10:06:08 pm

Title: [Solved] Drag and drop on closed application
Post by: jwdietrich on March 16, 2016, 10:06:08 pm
The attached demo droplet works well on Mac OS X, since it not only opens text files that are dropped on its form, but it also opens them, if they are dropped onto the icon of the application, even before it has been started.

Unfortunately, the latter function doesn't seem to be supported in Windows widgetsets. If I drop a text file onto the form of the (running) program all is fine, but if I drop it onto its icon before the application runs nothing happens.

What do I have to do to enable drag & drop operations that automatically start the program and relay a path to files that are dropped onto the icon?

Edit: Marked as solved.
Title: Re: Drag and drop on closed application
Post by: Bart on March 17, 2016, 01:01:57 am
AFAIK dropping files on a shortcut to an application in Windows will invoke the program with filename(s) as their paramstrings.

So then at program start chech those parameters and act upon it.

Bart
Title: Re: Drag and drop on closed application
Post by: Mando on March 17, 2016, 12:35:00 pm
HI.
Try this. It works for windows.

regarads.
Title: Re: Drag and drop on closed application
Post by: jwdietrich on March 17, 2016, 01:33:56 pm
Thanks.@Mando, I have simultaneously implemented Bart's suggestion, and my solution is similar to yours, see attached file. The only difference is that you read the ParamStrings in the main unit, while my program does it in the form's unit. I think that for large projects your solution may be the better one.

Thanks again.
TinyPortal © 2005-2018