简体   繁体   English

将自定义获胜表单挂接到Outlook检查器窗口C#

[英]hook custom win form to Outlook inspector window c#

I am in a situation where i need to give a popup on New mail inspector window (compose/reply/forward/replyall) whenever user attaches a file I need to popup a window which is happening as of now and I am able to show my form. 我处于一种情况下,每当用户附加文件时,我都需要在“新邮件检查器”窗口上弹出一个窗口(撰写/回复/转发/回复全部),我需要弹出一个窗口,该窗口截至目前为止,并且能够显示我的形成。 Right now the position of the form is my concern. 现在,我要关注表格的位置。 I managed to write manual adjustment code on Form load event to position it at desired location. 我设法在Form load事件上编写了手动调整代码,以将其定位在所需的位置。 But it is only for the case when user opens Compose mail window in Maximize mode. 但是仅在用户以“最大化”模式打开“撰写邮件”窗口时才适用。 If user manually resize the mail window or move it somewhere the form is messing completely and it is obvious as it is not hooked to parent. 如果用户手动调整邮件窗口的大小或将其移动到某处,则表单将完全混乱,这很明显,因为它没有挂钩到父窗口。

This is the code written on Form initialize event: 这是在Form initialize事件上编写的代码:

InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            Outlook.Application oApplication = Globals.ThisAddIn.Application;
            Outlook.Inspector inspector = oApplication.ActiveInspector();
            try
            {
                //Get current inspector window

                Utility.Top = inspector.Top;
                Utility.Left = inspector.Left;
                Utility.Width = inspector.Width - 270;
                Utility.Height = inspector.Height / 2;
                this.Location = new Point(Utility.Width, Utility.Height - 110);

Please help 请帮忙

I am not covering inspector window. 我没有覆盖检查员窗口。 It's a simply prompt for yes not action and it's very small window. 它只是提示您是否要执行操作,并且它的窗口很小。 Just want hook with inspector so it can at the same location as child with the parent inspector. 只需要与检查器挂钩,以便它可以与带有父检查器的孩子位于同一位置。 Or if inspector resizes 或者检查员调整大小

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM