首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >outlook C#加载项中的发送邮件不起作用

outlook C#加载项中的发送邮件不起作用
EN

Stack Overflow用户
提问于 2014-08-15 11:19:49
回答 1查看 312关注 0票数 0

我正在尝试获取Outlook C#外接程序,以便使用SendMessage滚动左侧导航窗格。这似乎没有效果。外接程序是否在比Outlook更低的权限级别下运行,因此由于UIPI而阻止SendMessage工作?

我使用EnumChildWindows (它是递归的)迭代来查找左侧导航窗格的子窗口的句柄,就像使用Spy++标识的那样,使用GetWindowText通过类名查找它。"workerBeeFunc“是由EnumChildWindows调用的委托。Spy++告诉我导航窗格窗口是第二个窗口的子窗口,第二个窗口的类名是"NUIDocumentWindow“(我把所有的WinAPI DLLImport语句都留在这里了):

代码语言:javascript
复制
private const int WM_VSCROLL = 277; // Vertical scroll
private const int SB_PAGEDOWN = 3; // Scrolls one page down
static StringBuilder childWindowNames = new StringBuilder();
private int NUIWindowCounter = 0;
private stopIterating as bool = false;

public delegate int EnumChildProc(IntPtr hWnd, IntPtr lParam);  //Declare the delegate

public int workerBeeFunc(IntPtr hwndChild, IntPtr Param) //The function the delegate of EnumChildWindows goes to to get the work done.
{
   int a;
   a = WinAPIs.GetWindowText(hwndChild, childWindowNames, 100); //childWindowNames gets cleared on each iteration of this function

   if (childWindowNames.ToString() == "NUIDocumentWindow")
   { 
      NUIWindowCounter++;


      if (NUIWindowCounter == 2)  //The NEXT window is the Navigation Pane
      {
         stopIterating = true;
      }
   return 1;  //Keep iterating
   }

   if (stopIterating == true)
   {
      SendMessage(hwndChild, WM_VSCROLL, (IntPtr)SB_PAGEDOWN, IntPtr.Zero);
      return 0;   //Stop iterating
   }
}

SendMessage会因为UIPI而静默失败吗?

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2014-08-15 12:05:52

外接程序在与Outlook本身相同的安全上下文中运行。

任何控件都不需要使用WM_VSCROLL消息。你真的在Spy++中看到它了吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25320794

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档