Drag&Drop from Outlook (Express) - Possible?
Drag&Drop from Outlook (Express) - Possible?
Hi,
does anyone know, how to drag&drop a msg-File (Outlook) or an eml-File (Outlook Express) to a e.g. Listicon?
I can do it from outlook to desktop and then from the desktop to a Listicon, but not the direct way.
I don`t want to use Webgadget for that...
What do I want to? -> I just wanna drag a message to e.g. Listicongadget -> this means saving the message to a special folder.
Does anyone know, if this is possible?
Thank you
Marco
does anyone know, how to drag&drop a msg-File (Outlook) or an eml-File (Outlook Express) to a e.g. Listicon?
I can do it from outlook to desktop and then from the desktop to a Listicon, but not the direct way.
I don`t want to use Webgadget for that...
What do I want to? -> I just wanna drag a message to e.g. Listicongadget -> this means saving the message to a special folder.
Does anyone know, if this is possible?
Thank you
Marco
PureBasic for Windows
You can handle any format with the PB DragDrop lib in theory.
You just have to know the format name and get an ID with RegisterClipboardFormat_()
Then call EnableGadgetDrop() with this format.
Then when you receive a drop event. EventDropSize() and EventDropBuffer()
can be used to access the data.
So it comes down to finding out the clipboard/drag & drop format used by Outlook.
Maybe this is documented somewhere. google is your friend.
You just have to know the format name and get an ID with RegisterClipboardFormat_()
Then call EnableGadgetDrop() with this format.
Then when you receive a drop event. EventDropSize() and EventDropBuffer()
can be used to access the data.
So it comes down to finding out the clipboard/drag & drop format used by Outlook.
Maybe this is documented somewhere. google is your friend.
quidquid Latine dictum sit altum videtur
1. Thank you
2. That`s too difficult for me...
I have no idea, what to do:
First I thought, I just have to do something like this:
thanx,
Marco
2. That`s too difficult for me...
I have no idea, what to do:
First I thought, I just have to do something like this:
Code: Select all
EnableGadgetDrop(#ListIcon, RegisterClipboardFormat_("outlook.application"), #PB_Drag_Copy)
thanx,
Marco
Last edited by Marco2007 on Sat May 23, 2020 8:41 pm, edited 1 time in total.
PureBasic for Windows
For single message drag'n'drop, I use
Code: Select all
cf_email = RegisterClipboardFormat_("Internet Message (rfc822/rfc1522)")
EnableGadgetDrop(#ListIcon, cf_email, #PB_Drag_Copy)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Hi Sparkie,
1. Thank you again!
2.
(rfc822/rfc1522) -> where did you get that and how can I get it for Outlook?
Do you know, how the file with such an Drag&Drop-Action can be stored e.g. c:\
This is the shorten code:
thx
Marco
I owe you one
1. Thank you again!
2.

Do you know, how the file with such an Drag&Drop-Action can be stored e.g. c:\
This is the shorten code:
Code: Select all
Enumeration
#Window
EndEnumeration
Enumeration
#ListIcon
EndEnumeration
Procedure Open_Window()
If OpenWindow(#Window, 820, 328, 448, 220, "Test", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window))
;-
ListIconGadget(#ListIcon, 20, 35, 350, 145, "Column", 340)
ButtonGadget(1,380, 170, 40, 20, "ok")
EndIf
EndIf
EndProcedure
Open_Window()
;cf_email = RegisterClipboardFormat_("Internet Message (rfc822/rfc1522)")
Debug cf_email
EnableGadgetDrop(#ListIcon, cf_email, #PB_Drag_Copy)
Repeat
event=WaitWindowEvent()
If Event = #PB_Event_GadgetDrop
Select EventGadget()
Case #ListIcon
;Files$ = EventDropFiles()
Debug EventDropType()
Debug EventDropSize()
Debug EventDropBuffer()
Count = CountString(Files$, Chr(10)) + 1
For i = 1 To Count
AddGadgetItem(#ListIcon, -1, StringField(Files$, i, Chr(10)))
Next i
EndSelect
EndIf
Until event=#WM_CLOSE
thx
Marco
I owe you one
PureBasic for Windows
For Outlook, try these...
Code: Select all
RegisterClipboardFormat_(#CFSTR_FILECONTENTS)
RegisterClipboardFormat_(#CFSTR_FILEDESCRIPTOR)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Thanx, Sparkie! It works with the Editor (but I got Problems with attachments - I only get the header in textformat)
Why isn`t that so easy like dragging from Explorer
From explorer I could do this:
Why doesn´t this one work? I guess, because it`s simply wrong!
The easiest way is webgadget, but in this case I don`t like the view with all the other folders and files...
thx
Marco
Why isn`t that so easy like dragging from Explorer

From explorer I could do this:
Code: Select all
Case #TargetFiles
Files$ = EventDropFiles()
CopyFile(Files$, "D:\"+GetFilePart(files$))
Why doesn´t this one work? I guess, because it`s simply wrong!
Code: Select all
Case #ListIcon
;Files$ = EventDropFiles()
Debug EventDropType()
size.l=EventDropSize()
*buffer=EventDropBuffer()
Debug size
Debug *buffer
If CreateFile(0, "d:\Text.eml")
WriteData(0, *buffer, size)
CloseFile(0)
Else
MessageRequester("Sorry", "Konnte die Datei nicht erstellen!")
EndIf
thx
Marco
PureBasic for Windows
I use this to retrieve the message text
Code: Select all
PeekS(*buffer)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
I'm at work right now Marco but when I get home I'll link you to an app of mine and you can see if it does what you want.
I'm not sure how the Desktop handles a drag'n'drop, but with Outlook Express, email messages are all contained in a single *.dbx files. such as Inbox.dbx, Sent.dbx and so on. AKAIK, the actual *.eml file does not exist until the target drag'n'drop handler creates it, which in my case is my app.

I'm not sure how the Desktop handles a drag'n'drop, but with Outlook Express, email messages are all contained in a single *.dbx files. such as Inbox.dbx, Sent.dbx and so on. AKAIK, the actual *.eml file does not exist until the target drag'n'drop handler creates it, which in my case is my app.
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Marco, try this code with Outlook Express ansd see if it's what you're looking for.
Code: Select all
If OpenWindow(0, 0, 0, 700, 500, "Drag 'n' drop Outlook Express",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ListIconGadget(1, 10, 10, 680, 100, "Drop Email here", 730)
cf_email = RegisterClipboardFormat_("Internet Message (rfc822/rfc1522)")
EnableGadgetDrop(1, cf_email, #PB_Drag_Copy)
EditorGadget(2, 10, 120, 680, 370)
Repeat
event = WaitWindowEvent()
If event = #PB_Event_GadgetDrop And EventGadget() = 1
Select EventDropType()
Case cf_email
ClearGadgetItemList(1)
ClearGadgetItemList(2)
*buffer = EventDropBuffer()
msg$ = PeekS(*buffer)
subject = FindString(msg$, "Subject:", 1) + 9
eos = FindString(msg$, #CRLF$, subject)
subject$ = Mid(msg$, subject, eos - subject)
AddGadgetItem(1, 0, subject$)
AddGadgetItem(2, 0, PeekS(*buffer))
EndSelect
EndIf
Until event = #PB_Event_CloseWindow
EndIf
End
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Sure, just add this, making sure you change the path to your desired location.

Code: Select all
eml = CreateFile(#PB_Any, "c:\" + subject$ + ".eml")
WriteString(eml, msg$)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1