如何停止 Outlook 替代问候语 pop-up,或自动关闭它
How stop Outlook alternative greeting pop-up, or close it automatically
我公司只有 1 名用户每次收到电子邮件时都会收到 pop-up,并且她已打开自动回复。我不能 post 图片,但是如果你去 imgur,并添加正斜杠和 'xooZR8D' 不带引号,你会看到弹出窗口。弹出窗口的标题是 Microsoft Outlook,弹出窗口的 body 是:您的 IMAP 服务器想要提醒您注意以下事项:[150] 当前正在使用您的备用问候语。
理想情况下,我想知道如何关闭它。或者,是否有人有 .Net 程序的代码(最好是 VB,C# 是我的第二选择)来扫描打开 windows 并关闭所需的代码?当我扫描打开的进程并找到一个标题为我想关闭的进程时,调用 process.close 或 process.closeMainWindow 什么也没做,并且 process.Kill 关闭了 window 和 Outlook应用程序,我不想要。 TIA
虽然没有找到问题的根源,但这是可行的:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ClosePopupsCSharp
{
public partial class Form1 : Form
{
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool IsWindowVisible(IntPtr hWnd);
static uint WM_CLOSE = 0x10;
public Form1()
{
InitializeComponent();
timer2.Enabled = true;
}
private void DeleteOutlookPopups()
{
timer2.Enabled = false;
IntPtr hWnd = FindWindowByCaption(IntPtr.Zero, "Microsoft Outlook");
if (hWnd != null)
{
if (IsWindowVisible(hWnd))
{
bool ret = CloseWindow(hWnd);
}
}
timer2.Enabled = true;
}
static bool CloseWindow(IntPtr hWnd)
{
SendMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
return true;
}
private void timer2_Tick(object sender, EventArgs e)
{
DeleteOutlookPopups();
}
}
}
我公司只有 1 名用户每次收到电子邮件时都会收到 pop-up,并且她已打开自动回复。我不能 post 图片,但是如果你去 imgur,并添加正斜杠和 'xooZR8D' 不带引号,你会看到弹出窗口。弹出窗口的标题是 Microsoft Outlook,弹出窗口的 body 是:您的 IMAP 服务器想要提醒您注意以下事项:[150] 当前正在使用您的备用问候语。
理想情况下,我想知道如何关闭它。或者,是否有人有 .Net 程序的代码(最好是 VB,C# 是我的第二选择)来扫描打开 windows 并关闭所需的代码?当我扫描打开的进程并找到一个标题为我想关闭的进程时,调用 process.close 或 process.closeMainWindow 什么也没做,并且 process.Kill 关闭了 window 和 Outlook应用程序,我不想要。 TIA
虽然没有找到问题的根源,但这是可行的:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ClosePopupsCSharp
{
public partial class Form1 : Form
{
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool IsWindowVisible(IntPtr hWnd);
static uint WM_CLOSE = 0x10;
public Form1()
{
InitializeComponent();
timer2.Enabled = true;
}
private void DeleteOutlookPopups()
{
timer2.Enabled = false;
IntPtr hWnd = FindWindowByCaption(IntPtr.Zero, "Microsoft Outlook");
if (hWnd != null)
{
if (IsWindowVisible(hWnd))
{
bool ret = CloseWindow(hWnd);
}
}
timer2.Enabled = true;
}
static bool CloseWindow(IntPtr hWnd)
{
SendMessage(hWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
return true;
}
private void timer2_Tick(object sender, EventArgs e)
{
DeleteOutlookPopups();
}
}
}