<legend id='rXdDu'><style id='rXdDu'><dir id='rXdDu'><q id='rXdDu'></q></dir></style></legend>

  • <tfoot id='rXdDu'></tfoot>
    <i id='rXdDu'><tr id='rXdDu'><dt id='rXdDu'><q id='rXdDu'><span id='rXdDu'><b id='rXdDu'><form id='rXdDu'><ins id='rXdDu'></ins><ul id='rXdDu'></ul><sub id='rXdDu'></sub></form><legend id='rXdDu'></legend><bdo id='rXdDu'><pre id='rXdDu'><center id='rXdDu'></center></pre></bdo></b><th id='rXdDu'></th></span></q></dt></tr></i><div id='rXdDu'><tfoot id='rXdDu'></tfoot><dl id='rXdDu'><fieldset id='rXdDu'></fieldset></dl></div>
      <bdo id='rXdDu'></bdo><ul id='rXdDu'></ul>

      1. <small id='rXdDu'></small><noframes id='rXdDu'>

        AxAcroPDF 吞键,如何让它停止?

        AxAcroPDF swallowing keys, how to get it to stop?(AxAcroPDF 吞键,如何让它停止?)

        <small id='9w7NJ'></small><noframes id='9w7NJ'>

              <bdo id='9w7NJ'></bdo><ul id='9w7NJ'></ul>
                  <tfoot id='9w7NJ'></tfoot>

                • <legend id='9w7NJ'><style id='9w7NJ'><dir id='9w7NJ'><q id='9w7NJ'></q></dir></style></legend>

                • <i id='9w7NJ'><tr id='9w7NJ'><dt id='9w7NJ'><q id='9w7NJ'><span id='9w7NJ'><b id='9w7NJ'><form id='9w7NJ'><ins id='9w7NJ'></ins><ul id='9w7NJ'></ul><sub id='9w7NJ'></sub></form><legend id='9w7NJ'></legend><bdo id='9w7NJ'><pre id='9w7NJ'><center id='9w7NJ'></center></pre></bdo></b><th id='9w7NJ'></th></span></q></dt></tr></i><div id='9w7NJ'><tfoot id='9w7NJ'></tfoot><dl id='9w7NJ'><fieldset id='9w7NJ'></fieldset></dl></div>
                    <tbody id='9w7NJ'></tbody>
                  本文介绍了AxAcroPDF 吞键,如何让它停止?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  AxAcroPDF 会在获得焦点后立即吞下所有与键相关的事件,包括快捷键、按键等.我添加了一个消息过滤器,它也没有收到任何与键相关的消息.它是一个 COM 组件,这可能是相关的吗?

                  The AxAcroPDF swallows all key-related events as soon as it gets focus, including shortcuts, key presses, etc. I added a message filter, and it doesn't get any key-related messages either. It's a COM component, could that be relevant?

                  有什么方法可以在控件开始吞噬它们之前捕获它们?

                  Is there any way to catch these before the control starts swallowing them?

                  推荐答案

                  Hans 是正确的,Acrobat Reader 生成了两个子 AcroRd32 进程,您无法从托管代码中直接访问它们.

                  Hans is correct, the Acrobat Reader spawns two child AcroRd32 processes which you have no direct access to from within your managed code.

                  我已经对此进行了实验,您有三个可行的选择:

                  I have experimented with this and you have three viable options:

                  1. 您可以创建一个全局系统挂钩,然后查找并过滤/响应发送到您的子 AcroRd32 窗口的 WM_SETFOCUS 消息.您可以使用包装库在 C# 中完成其中的一些操作,例如此处的一个:http://www.codeproject.com/KB/system/WilsonSystemGlobalHooks.aspx

                  1. You can create a global system hook, and then look for and filter out / respond to WM_SETFOCUS messages sent to your child AcroRd32 windows. You can accomplish some of this from within C# by using a wrapper library, such as the one here: http://www.codeproject.com/KB/system/WilsonSystemGlobalHooks.aspx

                  您还需要识别正确的进程,因为您的应用程序可能有多个实例,或者 AcroRd32 的其他实例.这是最具确定性的解决方案,但由于您的应用程序现在将过滤发送到存在的每个窗口的消息,因此我通常不推荐这种方法,因为这样您的程序可能会对系统稳定性产生负面影响.

                  You also need to identify the correct processes as there may be more than one instance of your application, or other instances of AcroRd32. This is the most deterministic solution, but because your application will now be filtering messages sent to every single window in existence, I generally don't recommend this approach because then your program could negatively affect system stability.

                  查找备用 PDF 查看控件.有关一些商业组件,请参阅此答案: .net PDF Viewer control ,或自己动手:http://www.codeproject.com/KB/applications/PDFViewerControl.aspx

                  Find an alternate PDF viewing control. See this answer for a few commercial components: .net PDF Viewer control , or roll your own: http://www.codeproject.com/KB/applications/PDFViewerControl.aspx

                  找到一个可接受的 hack.根据您的应用程序需要的健壮程度,以下代码可能是合适的(它适合我的情况):

                  Find an acceptable hack. Depending on how robust your application needs to be, code such as the following may be suitable (it was suitable for my case):

                  DateTime _lastRenav = DateTime.MinValue;
                  
                  public Form1()
                  {
                      InitializeComponent();
                  
                      listBox1.LostFocus += new EventHandler(listBox1_LostFocus);
                  }
                  
                  private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
                  {
                      axAcroPDF1.src = "sample.pdf";  //this will cause adobe to take away the focus
                      _lastRenav = DateTime.Now;
                  }
                  
                  void listBox1_LostFocus(object sender, EventArgs e)
                  {
                      //restores focus if it were the result of a listbox navigation
                      if ((DateTime.Now - _lastRenav).TotalSeconds < 1)
                          listBox1.Focus();
                  }
                  

                  这篇关于AxAcroPDF 吞键,如何让它停止?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                  Accessing attribute info from DTE(从 DTE 访问属性信息)
                  c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                  Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                  C# Attributes and their uses(C# 属性及其用途)
                  C# - Getting all enums value by attribute(C# - 按属性获取所有枚举值)
                    • <bdo id='aP1ab'></bdo><ul id='aP1ab'></ul>
                      • <legend id='aP1ab'><style id='aP1ab'><dir id='aP1ab'><q id='aP1ab'></q></dir></style></legend>

                          <small id='aP1ab'></small><noframes id='aP1ab'>

                          <tfoot id='aP1ab'></tfoot>
                            <i id='aP1ab'><tr id='aP1ab'><dt id='aP1ab'><q id='aP1ab'><span id='aP1ab'><b id='aP1ab'><form id='aP1ab'><ins id='aP1ab'></ins><ul id='aP1ab'></ul><sub id='aP1ab'></sub></form><legend id='aP1ab'></legend><bdo id='aP1ab'><pre id='aP1ab'><center id='aP1ab'></center></pre></bdo></b><th id='aP1ab'></th></span></q></dt></tr></i><div id='aP1ab'><tfoot id='aP1ab'></tfoot><dl id='aP1ab'><fieldset id='aP1ab'></fieldset></dl></div>
                              <tbody id='aP1ab'></tbody>