javascript 直接从 Web 应用程序中的 Outlook 拖放
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19924528/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Drag & Drop directly from Outlook in web app
提问by Greezer
I know this question is relating the same problem as mine :
我知道这个问题与我的问题有关:
but I'm looking for a workaround to achieve a drop from Outlook message into my webapp (currently only HTML5 / JS code).
但我正在寻找一种解决方法来实现从 Outlook 消息到我的 web 应用程序(目前只有 HTML5/JS 代码)。
Is it possible, with some activeX, to copy the message in a temp filesystem folder and then use this file reference ? I would like to know the faisability level.
是否可以使用某些 activeX 将消息复制到临时文件系统文件夹中,然后使用此文件引用?我想知道不可靠性水平。
Also, is it right that we can call a DLL from Jscript using ActiveX, like :
此外,我们可以使用 ActiveX 从 Jscript 调用 DLL 是否正确,例如:
var obj = new ActiveXObject("ABCDll.testMethod");
var vResult = obj.TestMethod();
alert(vResult);
BTW, if someone has any other suggestion to do a working Drag&Drop component (IE complient) for ANY files, incl. emails from Outlook (the only things that is not working for now...)
顺便说一句,如果有人有任何其他建议为任何文件做一个有效的拖放组件(IE 兼容),包括。来自 Outlook 的电子邮件(目前唯一不起作用的东西......)
Thanks a lot for any input.
非常感谢您的任何意见。
采纳答案by Dmitry Streblechenko
You can write a browser helper (for IE) in C++ or Delphi that retrieves the current drag/drop handler from IE and installs its own handler. When a message is dragged from Outlook, you can save it to a temp folder, then invoke the original drag/drop handler. After the handler returns, the temporary file can be deleted.
您可以在 C++ 或 Delphi 中编写一个浏览器助手(用于 IE),从 IE 检索当前的拖/放处理程序并安装它自己的处理程序。从 Outlook 拖动邮件时,您可以将其保存到临时文件夹,然后调用原始拖/放处理程序。处理程序返回后,可以删除临时文件。
I have done this in the past, and it works fine. You might want to looks at the Google Gears source code (no longer supported) that intercepts drag/drop in IE.
我过去曾这样做过,而且效果很好。您可能想查看在 IE 中拦截拖放的 Google Gears 源代码(不再支持)。
回答by wimix
Outlook uses the CFSTR_FILECONTENTS and CFSTR_FILEDESCRIPTORformats that many applications do not understand. My solutionfor this problem uses an Outlook Add-into intercept the D&D and convert the proprietary format into a usual file drop (CF_HDROP).
Outlook 使用许多应用程序不理解的CFSTR_FILECONTENTS 和 CFSTR_FILEDESCRIPTOR格式。我对这个问题的解决方案使用Outlook插件来拦截 D&D 并将专有格式转换为通常的文件放置 (CF_HDROP)。
The Add-in replaces the DoDragDrop function pointer in the import table of OLE32.DLL with a wrapper function (inside Outlook's memory address space). The wrapper converts the D&D data and calls the original function.
外接程序将 OLE32.DLL 的导入表中的 DoDragDrop 函数指针替换为包装函数(在 Outlook 的内存地址空间内)。包装器转换 D&D 数据并调用原始函数。
This articledescribes how to hook into an import table. Outlook's D&D stream format is explained here. The stream data has to be written into (temp) files in order to provide a simple CF_HDROP.
本文介绍如何挂钩导入表。此处解释了Outlook 的 D&D 流格式。流数据必须写入(临时)文件以提供简单的CF_HDROP。