<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Listen for escape pressed in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3746948#M51791</link>
    <description>&lt;P&gt;Thanks, that seems to work, but how do you unregister the listener? When escape is pressed I want to do something and then unregister the listener.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jan 2013 08:58:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-01-07T08:58:11Z</dc:date>
    <item>
      <title>Listen for escape pressed</title>
      <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3745957#M51789</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Is there a way to add a listener so I am told when escape(cancel command) is pressed? I want to create a cancel pressed event.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2013 10:57:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3745957#M51789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-04T10:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for escape pressed</title>
      <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3746198#M51790</link>
      <description>&lt;P&gt;This way can help you:&lt;/P&gt;
&lt;A href="http://adndevblog.typepad.com/autocad/2012/07/how-to-implement-a-windows-hook-using-acedregisterfilterwinmsg-in-net.html" target="_self"&gt;How to implement a Windows Hook using acedRegisterFilterWinMsg in .NET&lt;/A&gt;
&lt;P&gt;In &lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN&gt;&lt;SPAN style="color: #2b91af;"&gt;WindowHookProc&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; event handler you can check &lt;SPAN style="font-family: Courier New;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #000000;"&gt;msg.Msg&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; == &lt;FONT face="Consolas"&gt;&lt;FONT style="font-size: 8pt;"&gt;&lt;SPAN&gt;&lt;FONT color="#010001"&gt;WM_KEYDOWN&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt; (0x0100)&amp;nbsp; and msg.WParam == &lt;FONT face="verdana, geneva, helvetica" size="1"&gt;VK_ESCAPE&lt;/FONT&gt; (0x1B)&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2013 16:25:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3746198#M51790</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-01-04T16:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for escape pressed</title>
      <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3746948#M51791</link>
      <description>&lt;P&gt;Thanks, that seems to work, but how do you unregister the listener? When escape is pressed I want to do something and then unregister the listener.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2013 08:58:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3746948#M51791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-07T08:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for escape pressed</title>
      <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3747006#M51792</link>
      <description>&lt;P&gt;In order to unregister this event handler use function &lt;STRONG&gt;&lt;SPAN style="color: #660000;"&gt;acedRemoveFilterWinMsg&lt;/SPAN&gt;&lt;/STRONG&gt;:&lt;/P&gt;
&lt;PRE&gt;BOOL acedRemoveFilterWinMsg(
    const AcedFilterWinMsgFn pfn
);
&lt;/PRE&gt;
&lt;P&gt;In C# it is look like:&lt;/P&gt;
&lt;PRE&gt;// For AutoCAD 2013 64 bit
// On previous versions, import from acad.exe (instead accore.dll)
[DllImport("accore.dll",  CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedRemoveFilterWinMsg@@YAHQ6AHPEAUtagMSG@@@Z@Z")]
private static extern int acedRemoveFilterWinMsg( WindowHookProc callBackFunc );&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2013 10:36:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3747006#M51792</guid>
      <dc:creator>Alexander.Rivilis</dc:creator>
      <dc:date>2013-01-07T10:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for escape pressed</title>
      <link>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3747020#M51793</link>
      <description>&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2013 11:11:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/listen-for-escape-pressed/m-p/3747020#M51793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-07T11:11:51Z</dc:date>
    </item>
  </channel>
</rss>

