Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 1 Jahr, 6 Monaten
Letzter Beitrag:
vor 1 Jahr, 6 Monaten
Beteiligte Autoren:
Joris, Windev_man

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

Startbeitrag von Joris am 17.05.2016 12: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.

Antworten:

https://www.youtube.com/watch?v=MFKeSfyBe6Y

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,

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:\temp\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


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.