Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 1 Monat
Letzter Beitrag:
vor 2 Jahren, 1 Monat
Beteiligte Autoren:
Joris, Windev_man

WD20 : Drag and Drop : How to detect the source program

Startbeitrag von Joris am 17.05.2016 12:25


Is it possible to detect the name or some kind of reference from the program from where a user has started a drag and drop towards my Windev project?

What i want to achieve is that a user can DnD a file from Explorer or a mail from Outlook to only one target zone my application.

Thank you for helping.




von Windev_man - am 17.05.2016 15:56
Thank you but I still can't detect from where the DnD was started (Outlook or Explorer).

I have already a procedure to copy the files from explorer and a procedure to grab the selected mails from Outlook. The problem is I can't create a zone on my window where i can both drag and drop from Outlook and from Explorer.
I'm having 2 problems with it :
1- The DnD from Explorer is managed with 'ExplorerAccept' and the one from Outlook with '....DndTarget=dndProgram'. It seems impossible to combine these 2 methods in a single control.
2- I can't find an instruction to detect the source program of the DnD.

Kind regards,


P.S. Thanks to some postings on French forums i have created the code below. This is creating MSG files from the selected mails in Outlook.


L_Object_Outlook is object OLE "OutLook.Application"
L_MailItem is object Automation dynamic
LsSubject,LsFile,LsFullPath are string
LsDirectory is string = "c:\temp\MSG\"

FOR i = 1 _TO_ L_Object_Outlook>>ActiveExplorer>>Selection>>Count
L_MailItem = L_Object_Outlook>>ActiveExplorer>>Selection(i)
LsSubject = L_MailItem>>Subject
LsFile= ""
FOR j = 1 _TO_ Length(LsSubject)
CASE 34,42,47,58,60,62,63,92,124 : LsFile += "_"
OTHER CASE : LsFile += LsSubject[[j]]
IF LsFile = "" THEN LsFile = Now
LsFullPath = LsDirectory + ["\"] + LsFile + ".MSG"
Error("Het Outlook object kon niet worden omgezet in een .MSG bestand.",ExceptionInfo())

von Joris - am 18.05.2016 12:39
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.