用户关闭 Outlook 时如何附加处理程序?
私人无效 ThisAddIn_Shutdown(object 发送者,System.EventArgs e)基本无效。
在这里:VSTO Outlook 集成-Outlook 关闭事件以进行同步
我发现了一个建议连接到 Explorer.Close()和 Inspector.Close()。
在这里:http://social.msdn.microsoft.com/forums/en-US/vsto/thread/7e3c3a98-2b01-4def-a83c-f560e4672e73
Helmut 正在附加这样的处理程序:
_Inspector = inspector as Outlook.InspectorClass;
// register for the close event - used to release ourself from memory - intercept the close event
_Inspector.InspectorEvents_Event_Close += new Outlook.InspectorEvents_CloseEventHandler(_Inspector_InspectorEvents_Event_Close);
但是我无法在自己的机器上重复它(也许是我的新 outlook...)
有人可以帮忙吗?
1 回答
您必须将文件注入 OUTLOOK.EXE 进程,并且在此 dll 中,必须在 WndProc 中为 WM_CLOSE 消息进行处理。尝试使用此链接:如何处理 WNDPROC。并且此链接向您解释了所有内容,但这是关于您拥有 WM_CLOSE 的 GETMINMAXINFO 消息:关于注入 int WNDPROC 的所有信息