PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WD20 : Drag and Drop : How to detect the source program
WD20 : Drag and Drop : How to detect the source program
Iniciado por guest, 17,may. 2016 14:25 - 2 respuestas
Publicado el 17,mayo 2016 - 14:25
Hi,

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.


Joris.
Publicado el 17,mayo 2016 - 17:56
Publicado el 18,mayo 2016 - 14:39
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,

Joris



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.

http://www.developpez.net/forums/d1079049/environnements-developpement/windev/drag-drop-outlook-vers-table-windev/

L_Object_Outlook is object OLE "OutLook.Application" L_MailItem is object Automation dynamic LsSubject,LsFile,LsFullPath are string LsDirectory is string = "c:\ emp\MSG\" WHEN EXCEPTION IN 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) SWITCH(Asc(LsSubject[[j]])) CASE 34,42,47,58,60,62,63,92,124 : LsFile += "_" OTHER CASE : LsFile += LsSubject[[j]] END END IF LsFile = "" THEN LsFile = Now LsFullPath = LsDirectory + ["\"] + LsFile + ".MSG" L_MailItem>>SaveAs(LsFullPath) END DO Error("Het Outlook object kon niet worden omgezet in een .MSG bestand.",ExceptionInfo()) END