PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Extending the 'DROP FILE ON' functionality.  (Read 1546 times)

Rene

  • New Member
  • *
  • Posts: 1
    • View Profile
Extending the 'DROP FILE ON' functionality.
« on: September 13, 2018, 09:08:35 AM »
Customers are asking more and more to be able to drag documents and emails from Outlook to PxPlus.

It seems PxPlus currently only supports the CF_HDROP format.
I think the CFSTR_FILECONTENTS and the CFSTR_FILEDESCRIPTOR should be supported to address this.

(The CF_HDROP contains the paths of the files to be dropped, the other two the complete contents + description of the files.)

See also:
https://www.codeproject.com/articles/15576/how-to-drag-a-virtual-file-from-your-app-into-wind
https://superuser.com/questions/441747/dragging-attachments-from-outlook-into-applications

Best regards,

                  |)
                  |\ene'

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Extending the 'DROP FILE ON' functionality.
« Reply #1 on: September 13, 2018, 09:32:41 AM »
Generally this type of functionality is used to hold things such as emails, PDFs, and other documents for a entity such as a customer.  Personally I don't recommend storing these in your database but rather in a directory dedicated for the entity.  This make it easier to access long term (since you can simply open the file as opposed to extracting it first) and avoids having huge documents being placed in your database.

Assuming you implement it this way what I would suggest is to simply put a Shell.Explorer control on your panel targeting this directory so the user can drag and drop whatever they want there.  This allows them to drag almost anything (emails, files, videos, VCF files, etc,,) and makes it easy for them to open/view the items directly from the control.  In addition it provides excellent flexibility long term as file types and access capabilities get added to your systems.

If you do want more control over the files and want to store them elsewhere, you can use a similar approach but simply use the Shell.Explorer control as a temporary "Drop Zone" which you can monitor and once a file is dropped there you can move it wherever you want -- perhaps to another 'secured' directory from which you can control access.  If you want security you can provide a list to the user of what files are available from the secured directory and copy those to the Shell.Explorer control directory for the user to access.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com