<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.microsoft.co.il/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>class Alon : public CPP, public Architecture : C++, Interop</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/Interop/default.aspx</link><description>Tags: C++, Interop</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Message Only Window in for .NET Application</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2011/12/26/message-only-window-in-for-net-application.aspx</link><pubDate>Tue, 27 Dec 2011 02:16:00 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:969856</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=969856</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=969856</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2011/12/26/message-only-window-in-for-net-application.aspx#comments</comments><description>&lt;h4&gt;&amp;nbsp;&lt;/h4&gt;
&lt;h4&gt;Overview&lt;/h4&gt;
&lt;p&gt;.NET is great platform, it speeds up the development process, you deal with your application logic and in most cases you don&amp;#39;t need to know that there is whole Windows operating system down there. However sometimes you do need to program against Windows without the .NET assistance. As a Windows developer, you need to keep all your weapons ready, be it .NET, COM or C++ with the native Win32 API. In this article I am going to show how to deal with Windows Message based communication protocol within .NET application.&lt;/p&gt;
&lt;h4&gt;Windows Messages &lt;/h4&gt;
&lt;p&gt;In traditional &lt;font face="Consolas"&gt;User32.dll&lt;/font&gt; based Windows application the Windows Messages mechanism serves as a communication channel among many parties. The Windows Operating System uses this mechanism to ask the Window to draw itself, to inform about environmental change or even to communicate a logoff event. The application itself uses this mechanism to create an event driven design model with a single thread or to communicate between threads. Other applications can use this mechanism with an application defined message (the &lt;font face="Consolas"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms644930(v=vs.85).aspx" target="_blank"&gt;WM_APP&lt;/a&gt;&lt;/font&gt; message range) to trigger a logical event, or even to pass memory buffer using the &lt;font face="Consolas"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms649011(v=vs.85).aspx" target="_blank"&gt;WM_COPYDATA&lt;/a&gt;&lt;/font&gt;. &lt;/p&gt;
&lt;h4&gt;Windows In Windows Are Based On An Object Oriented Mechanism&lt;/h4&gt;
&lt;p&gt;One of the impressive thing about the windows mechanism of Windows, considering its age and the fact that it was implemented with the C language in mind, is that is based on the Object Oriented paradigm. Each window is belong to a &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632596(v=vs.85).aspx" target="_blank"&gt;Window Class&lt;/a&gt;. The class is the factory of a window. The class defines the window&amp;#39;s properties as well as the window&amp;#39;s behavior. The properties are set using one of the predefined window class member such as the window&amp;#39;s menu, or cursor. The behavior is defined by specifying the windows procedure address. The window procedure handles the incoming Windows Messages, which are in fact the methods of the window. Changing the Windows attributes can be made using the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;SetWindowLong&lt;/font&gt;&lt;/a&gt;&lt;font face="Consolas"&gt;/&lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms644898(v=VS.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;Ptr&lt;/font&gt;&lt;/a&gt;. Creating type fields (static) and instance fields can be made by allocating user-defined memory area for each Window class (static) and Window instance (dynamic) using the &lt;font face="Consolas"&gt;cbClsExtra&lt;/font&gt; and &lt;font face="Consolas"&gt;cbWndExtra&lt;/font&gt; fields of the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633576(v=vs.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;WNDCLASS&lt;/font&gt;&lt;/a&gt; structure. Subclassing a Windows class can be achieved by changing the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633569(v=vs.85).aspx" target="_blank"&gt;window procedure&lt;/a&gt; address to point to a custom function that handles the Windows Messages before it calls the original window procedure. You can subclass a Window instance or Window class (global subclassing).&lt;/p&gt;
&lt;h4&gt;Windows Do Not Run&lt;/h4&gt;
&lt;p&gt;In first look, it seems that that message communication is based on one window sending messages to another window, however windows do not run, threads do. Windows makes a correlation between threads and windows. The thread that calls &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632679(v=vs.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;CreateWindow&lt;/font&gt;&lt;/a&gt;&lt;font face="Consolas"&gt;/&lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680(v=vs.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;Ex&lt;/font&gt;&lt;/a&gt; is the thread that receives the Windows Messages related to this Window. In a common implementation of a Windows application, the main thread creates it&amp;#39;s main and child windows, and then starts a message loop, also known as message pump, pumping messages that has been sent to any of it&amp;#39;s windows, and dispatching this messages to the correct Window Procedure – the code that handle Windows Messages on behalf of the target Window. &lt;/p&gt;
&lt;h4&gt;Using Windows Messages Not For Painting The Window&lt;/h4&gt;
&lt;p&gt;Passing Windows Messages is one of the most easier inter process communication (IPC) mechanism, especially if the two parties are already implementing the Windows message handling boilerplate to handle their UI. One of the compelling feature of the mechanism is that it serves as a base for thread function call dispatching, enables a cross thread context call. For example in COM Single Threaded Apartment (STA), COM uses Windows Messages to dispatch function calls to the thread that created the component, much the same as dispatching messages to the windows created by the thread. This ensures that all the code of the COM component will be executed in a single thread- the idea behind the STA model.&amp;nbsp; &lt;/p&gt;
&lt;h4&gt;Message Only Window&lt;/h4&gt;
&lt;p&gt;There are cases that you need to communicate using Windows Messages with another application or component, but your application is not based on the traditional &lt;font face="Consolas"&gt;user32.dll&lt;/font&gt; Windows. This happens more and more in modern native and manage applications that are based on Console or DirectX, for example a .NET WPF based application. In such cases there is no need to create a window to handle these messages, since we do not care about painting the window or handling resize messages, we do not want to pay the cost of such a mechanism and we do not want to handle the hiding of such a window. For that in Windows 2000 Microsoft has added a new type of window type, the message-only-window. Creating such a window is very easy, all you need to do is to provide the &lt;font face="Consolas"&gt;HWND_MESSAGE&lt;/font&gt; as the window&amp;#39;s parent. You can do that in the &lt;font face="Consolas"&gt;CreateWindow/Ex&lt;/font&gt; or by using the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633541(v=VS.85).aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;SetParent&lt;/font&gt;&lt;/a&gt; function. You can use any predefined Window class, for example &lt;font face="Consolas"&gt;&amp;quot;STATIC&amp;quot;&lt;/font&gt;, or &lt;font face="Consolas"&gt;&amp;quot;Message&amp;quot;&lt;/font&gt;, as long as you subclass the window procedure to handle the coming Windows Messages. &lt;/p&gt;
&lt;h4&gt;Building A Message-Only-Window Client For .NET Applications&lt;/h4&gt;
&lt;p&gt;For handling system event, the .NET framework provides the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;Microsoft.Win32.SystemEvents&lt;/font&gt;&lt;/a&gt; class. However this class is made to receive Windows system event messages and can&amp;#39;t be extended to receive custom user messages. You can always use &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163417.aspx" target="_blank"&gt;Windows Form window to handle windows messages&lt;/a&gt;, however you will need to add reference to &lt;font face="Consolas"&gt;System.Windows.Forms.dll&lt;/font&gt; even if you don&amp;#39;t use Windows Forms, and you will need to hide the form.&amp;nbsp; A second approach, which I took, is to use C++/CLI assembly to create a message-only-window proxy. In this mechanism a native code handles the windows messages dispatching boilerplate. All is left for the managed code is to register a callback delegate on the message received event and ask the mechanism to start the message loop in the context of the thread that should handle the coming windows messages.&lt;/p&gt;
&lt;h4&gt;The Design&lt;/h4&gt;
&lt;p&gt;The &lt;font face="Consolas"&gt;NativeMessageOnlyWindow&lt;/font&gt; is a native class that handles the windows messages receiving, dispatching and handling. The &lt;font face="Consolas"&gt;MessageOnlyWindow&lt;/font&gt; is a managed C++/CLI wrapper (adapter) class that serves as the .NET interface for the mechanism. To bridge between the two, the &lt;font face="Consolas"&gt;MessageOnlyWindow&lt;/font&gt; class instantiates the native instance of the &lt;font face="Consolas"&gt;NativeMessageOnlyWindow&lt;/font&gt; and keeps it as a member that will be deleted on dispose.&amp;nbsp; The managed &lt;font face="Consolas"&gt;MessageOnlyWindow&lt;/font&gt; class implements the &lt;font face="Consolas"&gt;IMessageCallback&lt;/font&gt; interface. The native &lt;font face="Consolas"&gt;NativeMessageOnlyWindow&lt;/font&gt; gets and holds a &lt;font face="Consolas"&gt;gcroot&amp;lt;IMessageCallback ^&amp;gt;&lt;/font&gt; to the &lt;font face="Consolas"&gt;MessageOnlyWindow&lt;/font&gt; managed class in the constructor. When the &lt;font face="Consolas"&gt;NativeMessageOnlyWindow&lt;/font&gt; receives Windows messages it calls to the &lt;font face="Consolas"&gt;OnMessageReceivedCallback&lt;/font&gt; method of the &lt;font face="Consolas"&gt;IMessageCallback&lt;/font&gt; interface. To get a better understanding on calling from native to .NET see &lt;a href="http://blogs.microsoft.co.il/blogs/alon/archive/2007/05/29/Native-Callback.aspx" target="_blank"&gt;this blog post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/image_1A7452BD.png"&gt;&lt;img style="BACKGROUND-IMAGE:none;BORDER-RIGHT-WIDTH:0px;PADDING-LEFT:0px;PADDING-RIGHT:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;PADDING-TOP:0px;" title="image" border="0" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/image_thumb_683CDCA5.png" width="710" height="516" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To start pumping messages, the .NET client calls the &lt;font face="Consolas"&gt;MessageOblyWindow&lt;/font&gt; instance &lt;font face="Consolas"&gt;StartMessageLoop&lt;/font&gt; method. The call has to be made by the thread that created the Window that need to be handled. This call will not return until a call to &lt;font face="Consolas"&gt;StopMessageLoop&lt;/font&gt; will be made from any arbitrary thread.&lt;/p&gt;
&lt;h4&gt;The &lt;font face="Consolas"&gt;MessagePump.h&lt;/font&gt; header file&lt;/h4&gt;
&lt;div class="csharpcode"&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   1:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   3:  &lt;/span&gt;&lt;span style="COLOR:#008000;" class="rem"&gt;// MessagePump.h&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   5:  &lt;/span&gt;&lt;span style="COLOR:#cc6633;" class="preproc"&gt;#pragma&lt;/span&gt; once&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   6:  &lt;/span&gt;#include &amp;lt;Windows.h&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   7:  &lt;/span&gt;#include &amp;lt;hash_map&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   8:  &lt;/span&gt;#include &amp;lt;vcclr.h&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   9:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  10:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; System;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  11:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; std;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  12:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  13:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; MessagePump &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  14:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  15:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;//Callback wrapper &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  16:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;interface&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;class&lt;/span&gt; IMessageCallback&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  17:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//get called each time a new message is arrived to the message only window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  19:  &lt;/span&gt;        IntPtr OnMessageReceivedCallback(IntPtr hWnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  20:  &lt;/span&gt;    };&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  21:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  22:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;//Serves as a Windows Message Loop manager for the message only window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  23:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;class&lt;/span&gt; NativeMessageOnlyWindow&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  24:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  25:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;private&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  26:  &lt;/span&gt;        HWND m_hWnd;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  27:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;bool&lt;/span&gt; m_bStop;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  28:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  29:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//This map helps in correlating the hWnd we get in the WndProc to the &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  30:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//NativeMessageOnlyWindow instance of that Window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;static&lt;/span&gt; hash_map&amp;lt;HWND, NativeMessageOnlyWindow *&amp;gt; s_windowsMap;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  32:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  33:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Enables calling back to .NET interface method&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  34:  &lt;/span&gt;        gcroot&amp;lt;IMessageCallback ^&amp;gt; _messageCallback;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  35:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  36:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//To stop the message loop, we need to call PostQuitMessage in the context of the &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  37:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//message loop thread. To do that we are sending this message&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  38:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;static&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;const&lt;/span&gt; unsigned &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;int&lt;/span&gt; WM_APPSTOP = WM_APP + 242;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  39:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  40:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Create the message only window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  41:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; Create();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  42:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  43:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//The WndProc for the message only window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  44:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;static&lt;/span&gt; LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  45:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  46:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  47:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  48:  &lt;/span&gt;        NativeMessageOnlyWindow(&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;const&lt;/span&gt; gcroot&amp;lt;IMessageCallback ^&amp;gt; &amp;amp;&amp;amp;callback) : m_hWnd(0), &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  49:  &lt;/span&gt;            m_bStop(&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;false&lt;/span&gt;), _messageCallback(callback) {}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  50:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  51:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Stop the message loop, the actual stop happens asynchronously, since &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  52:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//we use PostQuitMessage&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  53:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; StopMessageLoop();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  54:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  55:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//A blocking call, the message loop is in the context of the calling thread&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  56:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; StartMessageLoop(); &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  57:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  58:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Return the message only window handle&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  59:  &lt;/span&gt;        HWND GetWindowHandle() &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;const&lt;/span&gt; { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; m_hWnd; }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  60:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  61:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Stop the message loop and destroy the instance&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  62:  &lt;/span&gt;        ~NativeMessageOnlyWindow();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  63:  &lt;/span&gt;    };&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  64:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  65:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  66:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;/// Represents a Windows Message that encapsulate in .NET type the WndProc arguments&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  67:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  68:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;value&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;class&lt;/span&gt; WindowsMessage&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  69:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  70:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;private&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  71:  &lt;/span&gt;        IntPtr            m_hwnd;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  72:  &lt;/span&gt;        unsigned &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;int&lt;/span&gt;    m_uMessage;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  73:  &lt;/span&gt;        UIntPtr            m_wParam;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  74:  &lt;/span&gt;        IntPtr            m_lParam;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  75:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  76:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  77:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  78:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Construct a new WindowsMessage class that holds the WndProc arguments&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  79:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  80:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;hWnd&amp;quot;&amp;gt;The target windows handle&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  81:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;message&amp;quot;&amp;gt;The message number&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  82:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;wParam&amp;quot;&amp;gt;the wParam&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  83:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;lParam&amp;quot;&amp;gt;the lParam&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  84:  &lt;/span&gt;        WindowsMessage(IntPtr hWnd, UINT message, WPARAM wParam, LPARAM lParam) : &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  85:  &lt;/span&gt;          m_hwnd(hWnd), m_uMessage(message), m_wParam(UIntPtr(wParam)), m_lParam(IntPtr(lParam)) {}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  86:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  87:  &lt;/span&gt;        property IntPtr HWnd { IntPtr get() { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; m_hwnd; }}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  88:  &lt;/span&gt;        property unsigned &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;int&lt;/span&gt; Message { unsigned &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;int&lt;/span&gt; get() { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; m_uMessage; }}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  89:  &lt;/span&gt;        property UIntPtr WParam { UIntPtr get() { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; m_wParam; }}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  90:  &lt;/span&gt;        property IntPtr LParam { IntPtr get() { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; m_lParam; }}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  91:  &lt;/span&gt;    };&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  92:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  93:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  94:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///Use this class to create a message only window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  95:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  96:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  97:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///With this class you can receive Windows Messages without the need to use a WinForm instance.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  98:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///Message only windows are lightweight mechanisms that serves only for receiving windows messages.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  99:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 100:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;ref&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;class&lt;/span&gt; MessageOnlyWindow : &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; IMessageCallback &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 101:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 102:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;private&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 103:  &lt;/span&gt;        NativeMessageOnlyWindow *m_pNativeMessageOnlyWindow;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 104:  &lt;/span&gt;    &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 105:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;protected&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 106:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 107:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// This callback functions receives the raw WndProc arguments for any message that has been &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 108:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// sent to the message-only-window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 109:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 110:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;hWnd&amp;quot;&amp;gt;The target windows handle&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 111:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;message&amp;quot;&amp;gt;The message number&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 112:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;wParam&amp;quot;&amp;gt;the wParam&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 113:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;param name=&amp;quot;lParam&amp;quot;&amp;gt;the lParam&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 114:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;returns&amp;gt;The method should return a value for the DefWndProc, usually &amp;lt;see cref=&amp;quot;IntPtr::Zero&amp;quot;/&amp;gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 115:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// is suitable&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 116:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;remarks&amp;gt;When overriding this method, call the base class implementation to fire the &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 117:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;see cref=&amp;quot;MessageReceived&amp;quot;/&amp;gt; event.&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 118:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;virtual&lt;/span&gt; IntPtr OnMessageReceivedCallback(IntPtr hWnd, UINT message, WPARAM wParam, LPARAM lParam) &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 119:  &lt;/span&gt;            = IMessageCallback::OnMessageReceivedCallback;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 120:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 121:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt;:&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 122:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 123:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///Constructor for the message only window instance&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 124:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 125:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 126:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///With this instance you can receive Windows Messages without the need to use a WinForm instance.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 127:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///Register a callback on the &amp;lt;see cref=&amp;quot;MessageReceived&amp;quot;/&amp;gt; event and call the &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 128:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;see cref=&amp;quot;StartMessageLoop&amp;quot;/&amp;gt; to start receiving windows messages.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 129:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Call the &amp;lt;see cref=&amp;quot;StopMessageLoop&amp;quot;/&amp;gt; to stop receiving windows messages.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 130:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Dispose the instance whenever you do not need it anymore&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 131:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 132:  &lt;/span&gt;        MessageOnlyWindow();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 133:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 134:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 135:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Fires an event that represents a single windows message that has been sent to &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 136:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// the message-only-window&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 137:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 138:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;event&lt;/span&gt; Func&amp;lt;WindowsMessage, IntPtr&amp;gt; ^MessageReceived;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 139:  &lt;/span&gt;        &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 140:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 141:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Ask the message pump thread to stop. &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 142:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 143:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 144:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// The message pump thread is the thread that called the &amp;lt;see cref=&amp;quot;StartMessageLoop&amp;quot;/&amp;gt;.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 145:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// The stop operations is asynchronously, This call trigger a WM_QUIT message that will &lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 146:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// eventually stop the loop&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 147:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 148:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; StopMessageLoop() { m_pNativeMessageOnlyWindow-&amp;gt;StopMessageLoop(); }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 149:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 150:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 151:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Start the message loop in the context of the calling thread&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 152:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 153:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 154:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// Call this method in the context of the thread that triggered the Windows Messages source.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 155:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// This is a blocking call, the message loop is in the context of the calling thread.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 156:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// This method will be return only after a call to the &amp;lt;see cref=&amp;quot;StopMessageLoop&amp;quot;/&amp;gt;.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 157:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 158:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; StartMessageLoop()  { m_pNativeMessageOnlyWindow-&amp;gt;StartMessageLoop(); }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 159:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 160:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 161:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// The message-only-window handle&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 162:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 163:  &lt;/span&gt;        property IntPtr WindowHandle { IntPtr get() &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 164:  &lt;/span&gt;                { &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; IntPtr(m_pNativeMessageOnlyWindow-&amp;gt;GetWindowHandle()); }}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 165:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 166:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 167:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// clear native resources&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 168:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 169:  &lt;/span&gt;        ~MessageOnlyWindow() { delete m_pNativeMessageOnlyWindow; }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 170:  &lt;/span&gt;    };&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 171:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 172:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;font face="Consolas"&gt;MessagePump.cpp&lt;/font&gt; code file&lt;/p&gt;
&lt;div class="csharpcode"&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   1:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   2:  &lt;/span&gt;&lt;span style="COLOR:#008000;" class="rem"&gt;//&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   3:  &lt;/span&gt;&lt;span style="COLOR:#008000;" class="rem"&gt;// Messagepump.cpp&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   5:  &lt;/span&gt;#include &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   6:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   7:  &lt;/span&gt;#include &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;MessagePump.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   9:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; System;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  10:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; System::Runtime::InteropServices;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  12:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  13:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; MessagePump &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  14:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  15:  &lt;/span&gt;    MessageOnlyWindow::MessageOnlyWindow() &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  16:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  17:  &lt;/span&gt;        m_pNativeMessageOnlyWindow = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;new&lt;/span&gt; NativeMessageOnlyWindow(gcroot&amp;lt;IMessageCallback ^&amp;gt;(&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;this&lt;/span&gt;));&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  18:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  19:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  20:  &lt;/span&gt;    IntPtr MessageOnlyWindow::OnMessageReceivedCallback(IntPtr hWnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  21:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; MessageReceived(WindowsMessage(hWnd, message, wParam, lParam));&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  23:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  24:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  25:  &lt;/span&gt;    hash_map&amp;lt;HWND, NativeMessageOnlyWindow *&amp;gt; NativeMessageOnlyWindow::s_windowsMap;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  26:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  27:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; NativeMessageOnlyWindow::Create()&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  28:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  29:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Create a Window that can only receive messages&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  30:  &lt;/span&gt;        m_hWnd = CreateWindow(L&lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;Message&amp;quot;&lt;/span&gt;, L&lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, 0, 0, 0, 0, 0, HWND_MESSAGE , nullptr, GetModuleHandle(0), nullptr);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;if&lt;/span&gt; (m_hWnd == nullptr)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  32:  &lt;/span&gt;            Marshal::ThrowExceptionForHR(GetLastError());&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  33:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  34:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Set the Window&amp;#39;s WndProc to our Windows Procedure&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  35:  &lt;/span&gt;        auto result = SetWindowLongPtr(m_hWnd, GWLP_WNDPROC, (LONG_PTR)WndProc);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  36:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;if&lt;/span&gt; (result == 0)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  37:  &lt;/span&gt;            Marshal::ThrowExceptionForHR(GetLastError());&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  38:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  39:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Keep the correlation between the hWnd and the MessageOnlyWindow instance&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  40:  &lt;/span&gt;        s_windowsMap[m_hWnd] = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;this&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  41:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  42:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  43:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; NativeMessageOnlyWindow::StopMessageLoop()&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  44:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  45:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Two stop marks&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  46:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  47:  &lt;/span&gt;        m_bStop = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  48:  &lt;/span&gt;        SendMessage(m_hWnd, WM_APPSTOP, 0, 0); &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  49:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  50:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  51:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  52:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; NativeMessageOnlyWindow::StartMessageLoop()&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  53:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  54:  &lt;/span&gt;        m_bStop = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  55:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Create the Windows&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  56:  &lt;/span&gt;        Create();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  57:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  58:  &lt;/span&gt;        MSG msg;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  59:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  60:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//The traditional message loop&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  61:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;while&lt;/span&gt; (GetMessage(&amp;amp;msg, NULL, 0, 0))&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  62:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  63:  &lt;/span&gt;            TranslateMessage(&amp;amp;msg);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  64:  &lt;/span&gt;            DispatchMessage(&amp;amp;msg);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  65:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  66:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  67:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  68:  &lt;/span&gt;    NativeMessageOnlyWindow::~NativeMessageOnlyWindow()&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  69:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  70:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;if&lt;/span&gt; (m_hWnd == nullptr)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  71:  &lt;/span&gt;            &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  72:  &lt;/span&gt;        StopMessageLoop();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  73:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  74:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  75:  &lt;/span&gt;    LRESULT CALLBACK NativeMessageOnlyWindow::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  76:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  77:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Find the correlated NativeMessageOnlyWindow instance&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  78:  &lt;/span&gt;        auto iter = s_windowsMap.find(hWnd);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  79:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;if&lt;/span&gt; (iter == s_windowsMap.end()) &lt;span style="COLOR:#008000;" class="rem"&gt;//instance not found&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  80:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  81:  &lt;/span&gt;            OutputDebugString(L&lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;NativeMessageOnlyWindow, a message can&amp;#39;t be dispatched, HWDN not found.&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  82:  &lt;/span&gt;            &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; DefWindowProc(hWnd, message, wParam, lParam);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  83:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  84:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  85:  &lt;/span&gt;        auto This = iter-&amp;gt;second;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  86:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  87:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;if&lt;/span&gt; (message == WM_APPSTOP &amp;amp;&amp;amp; This-&amp;gt;m_bStop) &lt;span style="COLOR:#008000;" class="rem"&gt;//Is Stop&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  88:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  89:  &lt;/span&gt;            PostQuitMessage(0); &lt;span style="COLOR:#008000;" class="rem"&gt;//Send WM_QUIT to stop the message loop&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  90:  &lt;/span&gt;            s_windowsMap.erase(iter); &lt;span style="COLOR:#008000;" class="rem"&gt;//Remove the NativeMessageOnlyWindow instance from the hash map&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  91:  &lt;/span&gt;            This-&amp;gt;m_hWnd = nullptr;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  92:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  93:  &lt;/span&gt;            &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; DefWindowProc(hWnd, message, wParam, lParam);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  94:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  95:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  96:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;//Trigger the callback call to the managed wrapper instance&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  97:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; reinterpret_cast&amp;lt;LRESULT&amp;gt;(&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  98:  &lt;/span&gt;            This-&amp;gt;_messageCallback-&amp;gt;OnMessageReceivedCallback(IntPtr(hWnd), message, wParam, lParam).ToPointer());&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  99:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 100:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt; 101:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="csharpcode"&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   1:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   2:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   3:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System.Runtime.InteropServices;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   4:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   5:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   6:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System.Threading;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   7:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; System.Threading.Tasks;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   8:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; MessagePump;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;   9:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  10:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  11:  &lt;/span&gt;&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;namespace&lt;/span&gt; TestMessagePump&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  12:  &lt;/span&gt;{&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  13:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  14:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;/// Summary description for UnitTest1&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  15:  &lt;/span&gt;    &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  16:  &lt;/span&gt;    [TestClass]&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  17:  &lt;/span&gt;    &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;class&lt;/span&gt; UnitTestMessagePump&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  18:  &lt;/span&gt;    {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///Gets or sets the test context which provides&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///information about and functionality for the current test run.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span style="COLOR:#008000;" class="rem"&gt;///&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; TestContext TestContext { get; set; }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  24:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  25:  &lt;/span&gt;        [DllImport(&lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;user32.dll&amp;quot;&lt;/span&gt;, CharSet = CharSet.Auto)]&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;static&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;extern&lt;/span&gt; IntPtr SendMessage(IntPtr hWnd, UInt32 msg, UIntPtr wParam, IntPtr lParam);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  27:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  28:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  29:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  30:  &lt;/span&gt;        &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;public&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;void&lt;/span&gt; TestMethodSendingMessages()&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  31:  &lt;/span&gt;        {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  32:  &lt;/span&gt;            var messagePump = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;new&lt;/span&gt; MessageOnlyWindow();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  33:  &lt;/span&gt;            var messageList = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;WindowsMessage&amp;gt;();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  34:  &lt;/span&gt;            var loopHasStarted = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;new&lt;/span&gt; ManualResetEventSlim(&lt;span style="COLOR:#0000ff;" class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  35:  &lt;/span&gt;&lt;span style="COLOR:#008000;" class="rem"&gt;// ReSharper disable InconsistentNaming&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  36:  &lt;/span&gt;            &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;const&lt;/span&gt; &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;uint&lt;/span&gt; WM_APP = 0x8000;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  37:  &lt;/span&gt;&lt;span style="COLOR:#008000;" class="rem"&gt;// ReSharper restore InconsistentNaming&lt;/span&gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  38:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  39:  &lt;/span&gt;            messagePump.MessageReceived += message =&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  40:  &lt;/span&gt;                                               {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  41:  &lt;/span&gt;                                                   &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;lock&lt;/span&gt; (messageList)&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  42:  &lt;/span&gt;                                                   {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  43:  &lt;/span&gt;                                                       messageList.Add(message);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  44:  &lt;/span&gt;                                                   }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  45:  &lt;/span&gt;                                                   loopHasStarted.Set();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  46:  &lt;/span&gt;                                                   &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;return&lt;/span&gt; IntPtr.Zero;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  47:  &lt;/span&gt;                                               };&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  48:  &lt;/span&gt;            &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;bool&lt;/span&gt; loopHasStopped = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  49:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  50:  &lt;/span&gt;            Task.Factory.StartNew(() =&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  51:  &lt;/span&gt;                                      {&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  52:  &lt;/span&gt;                                          messagePump.StartMessageLoop();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  53:  &lt;/span&gt;                                          loopHasStopped = &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  54:  &lt;/span&gt;                                      });&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  55:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  56:  &lt;/span&gt;            Thread.Sleep(1000);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  57:  &lt;/span&gt;            SendMessage(messagePump.WindowHandle, WM_APP, UIntPtr.Zero, IntPtr.Zero);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  58:  &lt;/span&gt;            var result = loopHasStarted.Wait(1000);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  59:  &lt;/span&gt;            Assert.AreNotEqual(result, &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;false&lt;/span&gt;, &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;Timeout, a message hasn&amp;#39;t arrived&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  60:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  61:  &lt;/span&gt;            SendMessage(messagePump.WindowHandle, WM_APP + 1, UIntPtr.Zero, IntPtr.Zero);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  62:  &lt;/span&gt;            SendMessage(messagePump.WindowHandle, WM_APP + 2, UIntPtr.Zero, IntPtr.Zero);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  63:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  64:  &lt;/span&gt;            Assert.AreNotEqual(loopHasStopped, &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;true&lt;/span&gt;, &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  65:  &lt;/span&gt;                       &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;The message Loop should not be stopped until we call the StopMessageLoop&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  66:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  67:  &lt;/span&gt;            messagePump.StopMessageLoop();&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  68:  &lt;/span&gt;            Thread.Sleep(3000);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  69:  &lt;/span&gt;            Assert.AreEqual(loopHasStopped, &lt;span style="COLOR:#0000ff;" class="kwrd"&gt;true&lt;/span&gt;,&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  70:  &lt;/span&gt;                       &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;The message Loop should stopped since we have called the StopMessageLoop&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  71:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  72:  &lt;/span&gt;            var numberOfAppMessages =&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  73:  &lt;/span&gt;                messageList.Count(&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  74:  &lt;/span&gt;                    message =&amp;gt;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  75:  &lt;/span&gt;                    message.Message == WM_APP || message.Message == WM_APP + 1 || message.Message == WM_APP + 2);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  76:  &lt;/span&gt;                &lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  77:  &lt;/span&gt;           Assert.AreEqual(numberOfAppMessages, 3, &lt;span style="COLOR:#006080;" class="str"&gt;&amp;quot;There should be three WM_APP + x Messages in the list&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  78:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  79:  &lt;/span&gt;        }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  80:  &lt;/span&gt;    }&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  81:  &lt;/span&gt;}&lt;/pre&gt;&lt;pre style="BACKGROUND-COLOR:#ffffff;MARGIN:0em;FONT-FAMILY:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;COLOR:black;FONT-SIZE:small;"&gt;&lt;span style="COLOR:#606060;" class="lnum"&gt;  82:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Download the VS 2010 solution from &lt;a href="https://skydrive.live.com/redir.aspx?cid=2804458381bc8909&amp;amp;resid=2804458381BC8909!11186&amp;amp;parid=2804458381BC8909!144" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=969856" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/VC/default.aspx">VC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/VS+2010/default.aspx">VS 2010</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/CPP_2F00_CLI/default.aspx">CPP/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/CodeValue/default.aspx">CodeValue</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows/default.aspx">Windows</category></item><item><title>My Dev Academy Lecture Recording</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2010/04/12/my-dev-academy-lecture-recording.aspx</link><pubDate>Mon, 12 Apr 2010 15:28:24 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:580397</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=580397</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=580397</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2010/04/12/my-dev-academy-lecture-recording.aspx#comments</comments><description>&lt;p&gt;In the last Dev Academy I have given a lecture in the TDM (R&amp;amp;D Manager) track about Software Porting, The Why, When, and How.&amp;#160; During the lecture I have talked about many different migration scenarios: from VB 6.0 to C#/VB.NET. From VC++ 6.0 to VC 2008/2010, From Unix/Linux to Windows, From old .NET to new .NET etc. I have talked about the porting project, best practices and tools. This is the &lt;a href="http://cid-2804458381bc8909.skydrive.live.com/embedicon.aspx/.Public/Porting%20Dev%20Academy%204.pptx" target="_blank"&gt;link&lt;/a&gt; to the lecture’s slides. There are many useful links inside it. This is the &lt;a href="http://iwebcast1web.you-niversity.com/SLVideoPLayer/Player.aspx?ID=1a0de49b-d82a-4a52-8cde-b3a168f054ec" target="_blank"&gt;link&lt;/a&gt; to the lecture video recording (sound track in Hebrew).&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=580397" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MFC/default.aspx">MFC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sela/default.aspx">Sela</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Dev+Academy/default.aspx">Dev Academy</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/CPP_2F00_CLI/default.aspx">CPP/CLI</category></item><item><title>Thanks to the people that came to the first meeting of the Windows Platform Developers User Group</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/05/thanks-to-the-people-that-came-to-the-first-meeting-of-the-windows-platform-developers-user-group.aspx</link><pubDate>Thu, 05 Nov 2009 07:39:44 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:438781</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=438781</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=438781</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/05/thanks-to-the-people-that-came-to-the-first-meeting-of-the-windows-platform-developers-user-group.aspx#comments</comments><description>&lt;p&gt;Thanks for all of you that despite the traffic jams, made it and came to the first meeting. And thanks again for your feedbacks, all of them were excellent!&lt;/p&gt;  &lt;p&gt;Here are the links for the resources that we talked about:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en" target="_blank"&gt;Windows 7 Training Kit&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=752CB725-969B-4732-A383-ED5740F02E93&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio 2010 Training Kit&lt;/a&gt; – The kit contains the MFC labs for the Windows 7 features &lt;/li&gt;    &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/XP2Win7" target="_blank"&gt;XP2Win7&lt;/a&gt; – stay tuned for a new release next week, or two. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Arun-Kishan-Farewell-to-the-Windows-Kernel-Dispatcher-Lock/" target="_blank"&gt;Removing the Kernel Dispatcher lock&lt;/a&gt; by Arun Kishan &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7/"&gt;Mark Russinovich: Inside Windows 7&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Mark-Russinovich-Inside-Windows-7-Redux/"&gt;Mark Russinovich: Inside Windows 7 Redux&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Parallel-Computing-in-Native-Code-New-Trends-and-Old-Friends/"&gt;Parallel Computing in Native Code: New Trends and Old Friends&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://channel9.msdn.com/shows/Going+Deep/Dave-Probert-Inside-Windows-7-User-Mode-Scheduler-UMS/"&gt;Dave Probert: Inside Windows 7 - User Mode Scheduler (UMS)&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My lecture about Windows 6.1 Kernel changes can be downloaded from &lt;a href="http://cid-2804458381bc8909.skydrive.live.com/self.aspx/.Public/NT6.1%20Kernel%20Changes.pptx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;We are waiting to your comments and suggestions for the forthcoming meetings. Please spread the news about the new group!&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=438781" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/VC/default.aspx">VC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Internal/default.aspx">Internal</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MFC/default.aspx">MFC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_0x/default.aspx">C++0x</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Server+2008+R2/default.aspx">Server 2008 R2</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Server+Core/default.aspx">Server Core</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multitouch/default.aspx">Multitouch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multi-touch/default.aspx">Multi-touch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Shell+Libraries/default.aspx">Shell Libraries</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Debbug/default.aspx">Debbug</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+Internals/default.aspx">Windows Internals</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/XP2Win7/default.aspx">XP2Win7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/User+Group/default.aspx">User Group</category></item><item><title>The first meeting of the Windows Platform Developers User Group</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/04/the-first-meeting-of-the-windows-platform-developers-user-group.aspx</link><pubDate>Wed, 04 Nov 2009 07:45:32 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:437892</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=437892</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=437892</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/04/the-first-meeting-of-the-windows-platform-developers-user-group.aspx#comments</comments><description>&lt;p&gt;Come and join &lt;a href="http://blogs.microsoft.co.il/blogs/pavely/" target="_blank"&gt;Pavel&lt;/a&gt; and me to the first meeting of the &lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032430253&amp;amp;Culture=he-IL" target="_blank"&gt;Windows Platform Developers user group&lt;/a&gt;. If the Windows platform is interesting you (and it probably does, otherwise you won’t be reading this post) you have to come. This is the chance to influence the spirit of the group. Pavel and I wanted to have a group for people like us. Those who develop for Windows with any needed tool, not just .NET or C++ but both and even more. The first meeting will be about Windows NT 6.1, this is the shortest way to say Windows 7 &amp;amp; Windows Server 2008 R2. Why did we decide to have this subject? we had three good reasons: First Windows 7 has just shipped to the public. Second we were deeply involved with the work behind delivering the message to the developer audience and third it is fun and interesting. In the spirit of the new group we will start by diving into kernel changes of the new operating system and we will see how we can leverage those enhancement in our code. The second part will be the fun part when we will show the new feature using lots of demos! &lt;/p&gt;  &lt;p&gt;This is the place to thank &lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/" target="_blank"&gt;Guy Burstein&lt;/a&gt; and &lt;a href="http://www.linkedin.com/pub/yifat-haramati/15/719/a82" target="_blank"&gt;Yifat Haramati&lt;/a&gt;, without them we could not have this new user group!&lt;/p&gt;  &lt;p&gt;So be there or be…&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;17:30 Microsoft Ra’anana, Dekel room&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=437892" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/VC/default.aspx">VC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Internal/default.aspx">Internal</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MFC/default.aspx">MFC</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_0x/default.aspx">C++0x</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Server+2008+R2/default.aspx">Server 2008 R2</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Debbug/default.aspx">Debbug</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+Internals/default.aspx">Windows Internals</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Dump/default.aspx">Dump</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/User+Group/default.aspx">User Group</category></item><item><title>More Windows Ribbon Tools &amp; Resources</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/01/more-windows-ribbon-tools-amp-resources.aspx</link><pubDate>Sun, 01 Nov 2009 18:19:45 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:436182</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=436182</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=436182</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2009/11/01/more-windows-ribbon-tools-amp-resources.aspx#comments</comments><description>&lt;p&gt;As the co-author of the “&lt;a href="http://www.amazon.com/Introducing-Windows%C2%AE-Developers-Yochay-Kiriaty/dp/0735626820/ref=ntt_at_ep_dpi_1" target="_blank"&gt;Introducing Windows® 7 for Developers&lt;/a&gt;” book&amp;#160; I wrote the two chapters about the new Windows Ribbon Framework. The first Ribbon chapter deals with the Ribbon markup language and the second chapter deals with the code behind. To let the reader the ability to understand and play with the markup language before reading the code behind chapter, I have created an open source project named &lt;a href="http://www.codeplex.com/RibbonExplorer" target="_blank"&gt;RibbonExpolorer&lt;/a&gt;. The Ribbon team from Microsoft has also created such a tool named &lt;a href="http://code.msdn.microsoft.com/PreviewRibbon" target="_blank"&gt;PreviewRibbon&lt;/a&gt; that they have just released.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;img alt="screen.png" src="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=PreviewRibbon&amp;amp;DownloadId=7909" width="640" height="460" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Both tools are good and both gives you the ability to play with the markup language. The main difference is that the &lt;a href="http://www.codeplex.com/RibbonExplorer" target="_blank"&gt;RibbonExplorer&lt;/a&gt; is built in C++ using ATL while the &lt;a href="http://code.msdn.microsoft.com/PreviewRibbon" target="_blank"&gt;PreviewRibbon&lt;/a&gt; is built in WinForm using .NET and COM interop. &lt;a href="http://www.codeplex.com/RibbonExplorer" target="_blank"&gt;RibbonExplorer&lt;/a&gt; also gives you the ability to change property values on the fly. So if you are a .NET developer that want to have a WinForm based application for Windows 7 and you want to have a Ribbon you can use the &lt;a href="http://code.msdn.microsoft.com/PreviewRibbon" target="_blank"&gt;PreviewRibbon&lt;/a&gt; sources as a good example for interoperating . Another great wrapper for .NET and WinForm can be found in &lt;a href="http://blogs.microsoft.co.il/blogs/arik/"&gt;Arik Poznanski&lt;/a&gt; blog series about the Windows 7 Ribbon.&lt;/p&gt;  &lt;p&gt;And again for full explanations of the Ribbon Markup Language and the Code behind, read the two chapters in the &lt;a href="http://www.amazon.com/Introducing-Windows%C2%AE-Developers-Yochay-Kiriaty/dp/0735626820/ref=ntt_at_ep_dpi_1" target="_blank"&gt;book&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/Introducing-Windows%C2%AE-Developers-Yochay-Kiriaty/dp/0735626820/ref=ntt_at_ep_dpi_1" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="Introducing Windows® 7 for Developers " border="0" alt="Introducing Windows® 7 for Developers " src="http://blogs.microsoft.co.il/blogs/alon/IntroducingWindows7forDevelopers_147340FD.jpg" width="244" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=436182" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Codeplex/default.aspx">Codeplex</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sela/default.aspx">Sela</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Ribbon+Explorer/default.aspx">Ribbon Explorer</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Book/default.aspx">Book</category></item><item><title>Make your application runs and shines on Windows 7</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2009/08/07/make-your-application-runs-and-shines-on-windows-7.aspx</link><pubDate>Fri, 07 Aug 2009 10:21:00 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:374269</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=374269</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=374269</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2009/08/07/make-your-application-runs-and-shines-on-windows-7.aspx#comments</comments><description>&lt;p&gt;Moving applications to new platform is not an easy decision to make. Sometimes you have no choice, new desktops and laptops run the new operating system and you have to support your clients. Sometimes you do have a choice, you install your application with the system and you can choose the operating system that your code will run on. There are two factors in this dilemma: first is the investment effort on making the application compatible with the new O/S comparing to the benefit (ROI). Second is that the application will probably need to continue running on the old operating system. In the case of Windows 7, if you have moved to Windows Vista, compatibility is almost not an issue, but if your application is still running on Windows XP than you have to invest a little to move it to the new platform. To help you moving to a new platform Microsoft DPE has contracted us (&lt;a href="http://www.sela.co.il/?CategoryID=563" target="_blank"&gt;Sela&lt;/a&gt;) to develop Compatibility Labs (Part of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en" target="_blank"&gt;Windows 7 Training kit&lt;/a&gt;) that guide you through the common compatibility issues that you may encounter moving your application from Windows XP to Windows 7. The labs provide two levels of information on each of the problems. The first level is based on few slides that describe the problem and the way to solve it, and a deeper level that gives you much more details as well as a code sample of the problem and the solution, both in native (C++) code and managed (C#) code.&lt;/p&gt;
&lt;p&gt;So, you have moved your application and it now can run on both platforms, now it is the time to make it Windows 7 friendly. Here you have another dilemma, most of the new features are Windows 7 only features, some are Vista based and other will be downgrade also to Windows XP. If you will use a Windows 7 only feature, your application will not run on Windows XP. &lt;/p&gt;
&lt;p&gt;To solve this problem I like to divide the new features to two groups. The first group is the group of features that you based your application core implementation on. For example, if you decide to use the .NET framework 3.0 as your runtime, you cannot install your application on Windows 2000. For the most of us, this is not an issue, for others it is a show stopper. So if you need I/O priority and Transactional File System for your application implementation, you need Windows NT 6.0 (Vista, Server 2008) as your minimum bar. In 4-5 years, for most of us it may be not an issue. &lt;/p&gt;
&lt;p&gt;The second group is the group of features that make your application shines on the new platform, or at least looks new and modern like the new platform does. For Windows 7, the Ribbon, the Taskbar, Multi-touch support and Restart Manager are good samples of such features. With good design you can add these features to your application as add-ons making it compatible to Windows XP and great on Windows 7. &lt;/p&gt;
&lt;p&gt;To learn how to use these new features we have made with Redmond DPE two projects. The first one is the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1C333F06-FADB-4D93-9C80-402621C600E7&amp;amp;displaylang=en" target="_blank"&gt;Windows 7 Training Kit&lt;/a&gt; it contains slides, demos and Hands on Labs for the new Windows 7 features. You will find .NET (C#) labs and demos as well as many native (C++) labs and demos. If you have downloaded the RC Kit in the past, download again. We have added new labs for the RTM. &lt;/p&gt;
&lt;p&gt;The second way to learn how to use new features in Windows NT 6.0 and Windows NT 6.1 is to download the &lt;a href="http://code.msdn.microsoft.com/XP2Win7" target="_blank"&gt;XP2Win7&lt;/a&gt; project. The project is still in its beta phase and we are working hard to fix bugs, simplify it and add some more features. &lt;a href="http://code.msdn.microsoft.com/XP2Win7" target="_blank"&gt;XP2Win7&lt;/a&gt; is an application that can be installed and runs on 9 different platforms (only 8 have been tested). The platforms are Windows XP, Windows Vista x86, Windows Vista x64, Windows Vista WOW 64 (x86 on x64 machine), Windows 7 x86, Windows 7 x64 and Windows 7 WOW64. Of course it should run also on the server platforms, but we have not tested this scenario. &lt;/p&gt;
&lt;p&gt;When you install the application on Windows XP, you get a simple picture album viewer. Installing it on Windows vista enables new features such as Aero Glass, Restart Manager, NT service is moved to be a Scheduler Task, A preview handler for the album is installed, Transactional NTFS is used with SQL server. Moving to Windows 7 enables another set of features such as Shell Library support, Taskbar integration, Multi-touch, Sensor and Location and Trigger Start Service. &lt;/p&gt;
&lt;p&gt;The installation kit also installs the source code. To build the application you need Windows 7, Visual Studio 2008 SP1, Windows 7 SDK (most of the code is managed and can be built and “single-step debug” without the need for the SDK). To build the native x64 project you need to install the x64 compiler tools that are not installed by default by the VS 2008 setup program. To run the application you also need SQL Server express edition. We are planning to lower the bar and remove the SQL Server dependency from the code. So if you want to see how to do a distributed transaction of TxNTFS and SQL Server, download the beta code, it will not be there in the release. &lt;/p&gt;
&lt;p&gt;This is also the place to thanks &lt;a href="http://windowsteamblog.com/blogs/developers/default.aspx" target="_blank"&gt;Yochay Kiriaty&lt;/a&gt; from Redmond DPE that gave us the chance to be part of such great projects and to David Bassa the CEO of &lt;a href="http://www.sela.co.il/?CategoryID=563" target="_blank"&gt;Sela&lt;/a&gt; that made it possible. Also thanks to Dima Zurbalev, &lt;a href="http://blogs.microsoft.co.il/blogs/sasha" target="_blank"&gt;Sasha Goldshtein&lt;/a&gt;, and Noam Sheffer that spent (and still) nights (daytime at Redmond) and days in the last few months and to Josh Reuben, &lt;a href="http://blogs.microsoft.co.il/blogs/arielbh/" target="_blank"&gt;Ariel Ben Horesh&lt;/a&gt;, Ram Dayan, &lt;a href="http://www.linkedin.com/pub/konstantin-triger/0/837/2a" target="_blank"&gt;Konstantin Triger&lt;/a&gt;, &lt;a href="http://blogs.microsoft.co.il/blogs/tomershamam/" target="_blank"&gt;Tomer Shamam&lt;/a&gt; and Pavel Yosifovich that also took part in the projects.&lt;/p&gt;
&lt;p&gt;Stay tune, more projects are coming! &lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=374269" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sela/default.aspx">Sela</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multitouch/default.aspx">Multitouch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multi-touch/default.aspx">Multi-touch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Library/default.aspx">Library</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Shell+Libraries/default.aspx">Shell Libraries</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/XP2Win7/default.aspx">XP2Win7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/S_2600_amp_3B00_L/default.aspx">S&amp;amp;L</category></item><item><title>Finally – Our Windows 7 .NET Wrappers are out</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2009/03/14/finally-our-windows-7-net-wrappers-are-out.aspx</link><pubDate>Sat, 14 Mar 2009 08:45:00 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:247923</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>45</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=247923</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=247923</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2009/03/14/finally-our-windows-7-net-wrappers-are-out.aspx#comments</comments><description>&lt;p&gt;During the last few months a small team from &lt;a href="http://www.sela.co.il/" target="_blank"&gt;Sela&lt;/a&gt;, has developed course materials, exercises and demos for the DPE Metro Program, that show how to develop with the new features of Windows 7. As you may know, all of the new feature of the system are exposed to native developer, using Win32 API and COM. To use C# and .NET we developed set of wrappers. &lt;a href="http://blogs.microsoft.co.il/blogs/sasha/" target="_blank"&gt;Sasha&lt;/a&gt; developed the Taskbar wrappers, and also &lt;a href="http://blogs.microsoft.co.il/blogs/sasha/archive/2009/03/06/windows-7-taskbar-thumbnail-clip-and-custom-previews.aspx" target="_blank"&gt;wrote&lt;/a&gt; about it in his blog. Dima developed the Sensor &amp;amp; Location Platform wrappers and I developed the Shell Libraries wrapper and the Multi-touch wrappers. &lt;/p&gt;
&lt;p&gt;You can download these wrappers from here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://code.msdn.microsoft.com/Windows7Taskbar" target="_blank"&gt;Taskbar &amp;amp; Libraries&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://code.msdn.microsoft.com/SensorsAndLocation" target="_blank"&gt;Sensor &amp;amp; Location Platform&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://code.msdn.microsoft.com/WindowsTouch" target="_blank"&gt;Multi-touch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For the Taskbar &amp;amp; Libraries we have used the Vista Bridge project with few modifications. The other wrappers don’t depend on the Vista Bridge. Currently the Windows Bridge team is looking at our wrappers as a prototype for the next version of the bridge, and they are in contact with us.&lt;/p&gt;
&lt;h2&gt;So, what is in there for you?&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/sasha/" target="_blank"&gt;Sasha&lt;/a&gt; has wrote a lot about the Taskbar. I will talk briefly about the other wrappers and in future posts I will dive into the gory details.&lt;/p&gt;
&lt;h3&gt;Sensor &amp;amp; Location Platform&lt;/h3&gt;
&lt;p&gt;The Sensor API is designed for working with sensors (light, accelerometer, buttons, temperature, etc.) in a vendor-independent manner. In previous Windows versions you had to learn and target each vendor&amp;#39;s specific API.&lt;/p&gt;
&lt;p&gt;The Location API builds upon the Sensor API and provides location information for location-aware application. The location information may be provided from many different sources: GPS, WiFi hotspot or GSM cell triangulation. Windows 7 Sensors and Location platform selects for you the best source automatically with no need to even understand the different providers. For the developer, this new set of APIs provides an abstraction of the underline infrastructure freeing the developer to handle the high level of application logic. &lt;/p&gt;
&lt;p&gt;The API has many benefits (a partial list):&lt;/p&gt;
&lt;p&gt;1. Frees you from the burden of interpreting various protocols used by GPS receivers (NMEA +non-standard extensions, NMEA2000 and others.&lt;/p&gt;
&lt;p&gt;2. Not bound to any particular technology or vendor. No need for serial port/emulation.&lt;/p&gt;
&lt;p&gt;3. Multiple applications may use the information simultaneously.&lt;/p&gt;
&lt;p&gt;The S&amp;amp;L (Sensor &amp;amp; Location) wrapper is a framework that provide a managed access to the S&amp;amp;L Platform. It is a framework, because the design allows hardware vendor to extend the wrapper to support new .NET sensor types.&lt;/p&gt;
&lt;p&gt;As opposed to the native API that are based on COM GUID for any type information the .NET wrapper is based on strong type design. This means that the developer knows the sensor type that she uses, and the exact report that she gets. For example for ambient light sensor, a specific data report will be generated with a strong type property telling the light intensity reading in LUX. In future post I will talk more about the wrapper. &lt;/p&gt;
&lt;h3&gt;Shell Library&lt;/h3&gt;
&lt;p&gt;Windows 7 introduces a new concept of Libraries as destinations where users can use their files as collections of items that may span multiple locations across computers. Libraries supersede the functionality of previous Windows versions known folders (e.g. Documents, Pictures, Music) and replace them as a main “storage” destination. Applications have a straightforward method for interacting with Libraries programmatically with the Library API. They can create, interact with and support Libraries as first-class items in their experiences.&lt;/p&gt;
&lt;p&gt;In previous versions of Windows, each application had its own proprietary library. For example, Windows Media Player had a different set of scopes than iTunes and neither was consistent with your Music Folder. With the Library API applications can define and consume a consistent set of user-defined scopes.&lt;/p&gt;
&lt;p&gt;Libraries may also contain network folders. This enables a better user experience at work and at home. Whenever the user opens a common file dialog he or she gets an aggregation view of all of the library locations that are available. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/image_0F0D21B0.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="image" border="0" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/image_thumb_00524FFE.png" width="532" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Shell managed wrapper can be found under the &lt;b&gt;Windows7.DesktopIntegration.dll&lt;/b&gt;. It contains wrappers for the new Windows Shell Taskbar and the new Windows Shell Libraries which in turn depends on the Windows Vista Bridge. The Vista Bridge that comes with this project is based on version 1.4, and it is slightly modified to support some of the new Windows 7 features.&lt;/p&gt;
&lt;p&gt;To support the Windows Shell Libraries operations, the Windows 7 Integration Library contains the &lt;b&gt;ShellLibrary&lt;/b&gt; class. The class has few static functions to create, load or delete a library and many other instance methods to work on the library instance itself.&lt;/p&gt;
&lt;p&gt;Using the class is just a matter of using one of the static functions to get a &lt;b&gt;ShellLibrary&lt;/b&gt; instance and then calling a method on that instance. The following code opens an existing library and adds new folder location to it:&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;COLOR:blue;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;public&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt; &lt;span style="COLOR:blue;"&gt;static&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;void&lt;/span&gt; AddFolder(&lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; name, &lt;span style="COLOR:blue;"&gt;string&lt;/span&gt; folderPath) &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;{ &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;COLOR:blue;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;using&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt; (&lt;span style="COLOR:#2b91af;"&gt;ShellLibrary&lt;/span&gt; library = &lt;br /&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="mso-tab-count:2;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;ShellLibrary&lt;/span&gt;.Load(&lt;span style="COLOR:#2b91af;"&gt;ShellLibrary&lt;/span&gt;.CreateLibraryFullName(name), &lt;span style="COLOR:blue;"&gt;true&lt;/span&gt;)) &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{ &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;library.AddFolder(folderPath); &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="FONT-FAMILY:consolas;FONT-SIZE:9pt;mso-bidi-font-family:arial;mso-bidi-theme-font:minor-bidi;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/b&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;More on Shell Libraries in future posts.&lt;/p&gt;
&lt;h3&gt;Multi-touch&lt;/h3&gt;
&lt;p&gt;One of the more exiting features of Windows 7 is the multi-touch support. First I have to admit that I had so much fun writing code and cool demos for multi-touch. I have two multi-touch machines, one is the &lt;a href="http://www.hp.com/united-states/campaigns/touchsmart/#" target="_blank"&gt;HP Touchsmart&lt;/a&gt;, a 25.5” dual touch all-in-one computer which runs the Windows 7 beta 64 bit version, and another &lt;a href="http://www.dell.com/content/products/productdetails.aspx/latit_xt?c=us&amp;amp;cs=04&amp;amp;l=en&amp;amp;s=bsd"&gt;Dell latitude XT&lt;/a&gt; machine, that has a true multi-touch support from &lt;a href="http://www.n-trig.com/"&gt;N-Trig&lt;/a&gt; which runs the 32bit version of Windows 7. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.hp.com/united-states/campaigns/touchsmart/#"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="TouchSmart" border="0" alt="TouchSmart" src="http://blogs.microsoft.co.il/blogs/alon/image_4652E744.png" width="298" height="250" /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://www.dell.com/content/products/productdetails.aspx/latit_xt?c=us&amp;amp;cs=04&amp;amp;l=en&amp;amp;s=bsd"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="Dell Latitude XT" border="0" alt="Dell Latitude XT" src="http://blogs.microsoft.co.il/blogs/alon/image_086629FB.png" width="219" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Windows application can target one of 3 levels of touch integration:&lt;/p&gt;
&lt;p&gt;&lt;font color="#ffff00"&gt;Good&lt;/font&gt;: No specific touch APIs are used but the application UI is appropriately sized and &lt;br /&gt;works well with the built-in gestures&lt;/p&gt;
&lt;p&gt;&lt;font color="#ffff00"&gt;Better&lt;/font&gt;: The gesture APIs are supported to give &lt;br /&gt;smooth natural interactions&lt;/p&gt;
&lt;p&gt;&lt;font color="#ffff00"&gt;Best&lt;/font&gt;: Deep touch focused experiences designed &lt;br /&gt;to take advantage of Multi-touch&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Windows 7 User32 controls have built-in support for multi-touch, for example you can scroll text in a Window using your fingers.&lt;/p&gt;
&lt;p&gt;When you want to add touch support to your application you need to get touch information from Windows. There are two different approaches to choose from. The easiest approach is to let Windows understand the user intent. The user uses her fingers to take actions like rotate, translate, scale, double finger tap, and so on. You can ask Windows to interprets these actions to a simple Windows message called gesture, that informs your application about the specific action with the related data. For example the user did scaling operation with 2.5 scaling factor. There are two main problems with this simple approach. The first is that you get only one interpretation for the user action. If the user rotate and scale in the same time, you will get only one gesture, not both. The second problem is that is the user needs to manipulate more then one object in the screen, let say by using her two hands, or another user’s hand, you will not get the correct interpretation at all. &lt;/p&gt;
&lt;p&gt;To overcome these problems you should register to get the low level Windows Message, which is the WM_TOUCH message. This gives you the row touch information. You need to decode the message, there is a good chance that this one message contains many different touch messages from each and any of the fingers that simultaneously touch the screen. The next action is to decide which message is belong to which item. Suppose you have many pictures on the screen, you need to correlate the touch message to the target picture. This can be done by doing hit-test using the location information of the touch event. Now you have to figure out what is the user intent. This is a hard task if you need to do it yourself, but don’t worry, Windows 7 provides a Manipulation Processor that does it for you. All you need to do is to pass the row touch message to the Manipulation Processor, and to get the Manipulation Delta event from it, which in turn is very similar to the gesture information, but include all the actions together. If you also want to have an inertia on each of the object you can use the Inertia Processor. This Processor is a little bit complicated and I will write about it in a future post.&lt;/p&gt;
&lt;p&gt;All of those messages and API are native Win32 and COM based. WPF 4.0 will have a full support for touch enabled applications, including Manipulation and Inertia. If you don’t want to wait to WPF 4.0 or you need to crate WinForms base touch enabled applications, you can use our wrapper. The wrapper lets you create a touch handler for WinForm, or WPF (or even for any User32 Windows Handle). This handler can be GestureHandler or TouchHandler. After creating the handler you should register for the gesture or touch events. If you use the TouchHandler you will probably create at least one instance of ManipulationProcessor or ManipulationInertiaProcessor which wrapps the native COM based processors.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/image_6B9C8F18.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="image" border="0" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/image_thumb_1E3C2426.png" width="644" height="417" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you have a WPF 3.5 application you can use the stylus events as touch events, just use the WPF handler to enable WPF touch events.&lt;/p&gt;
&lt;p&gt;To get better understanding of how to use the touch wrapper we created many demos, for WinForm, WPF and even a C++/CLI Win32 application that uses the wrapper. I will write a future post with more details.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;Windows 7 is a cool operating system. The end-user gets a better experience when using the Shell and the built-in applications, but it is our task to use the cool features in our own applications. For the .NET developer, we will get better support in the future, whether in .NET 4.0 or from the Windows Bridge team, but for now you can enjoy using the wrappers that we developed for DPE.&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=247923" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/MVP/default.aspx">MVP</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Win32/default.aspx">Win32</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sela/default.aspx">Sela</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/DEV/default.aspx">DEV</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Server+2008+R2/default.aspx">Server 2008 R2</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multitouch/default.aspx">Multitouch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Multi-touch/default.aspx">Multi-touch</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Library/default.aspx">Library</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Taskbar/default.aspx">Taskbar</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Shell+Libraries/default.aspx">Shell Libraries</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Sensor+and+Location/default.aspx">Sensor and Location</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/S_2600_amp_3B00_L/default.aspx">S&amp;amp;L</category></item><item><title>Back to the Future - Summary of my lecture at Tech-Ed Eilat</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2008/04/07/back-to-the-future-summary-of-my-lecture-at-tech-ed-eilat.aspx</link><pubDate>Mon, 07 Apr 2008 17:05:17 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:72488</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=72488</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=72488</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2008/04/07/back-to-the-future-summary-of-my-lecture-at-tech-ed-eilat.aspx#comments</comments><description>&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1397ad5f-504b-4252-a922-39d83c43cf3d" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/COM+" rel="tag"&gt;COM+&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WCF" rel="tag"&gt;WCF&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Architecture" rel="tag"&gt;Architecture&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C++" rel="tag"&gt;C++&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SOA" rel="tag"&gt;SOA&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_141F3/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="356" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_141F3/image_thumb_1.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;For all of you who have been at my lecture I hope that you enjoyed and that you have learned few new things, If you didn&amp;#39;t get my message, here is a summary:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Think about the future, the present is the past of the future. &lt;/li&gt;    &lt;li&gt;Invest in the architecture. &lt;/li&gt;    &lt;li&gt;Decoupling is the name of the game, always was and always will be. &lt;/li&gt;    &lt;li&gt;Know your framework roadmap. &lt;/li&gt;    &lt;li&gt;New technologies make decoupling easier. &lt;/li&gt;    &lt;li&gt;Using WCF interoperabilities lets you re-use old code component &lt;/li&gt;    &lt;li&gt;Using WCF interoperabilities lets you use WCF based service as a component &lt;/li&gt;    &lt;li&gt;Porting ASP.NET ASMX based web services is easy &lt;/li&gt;    &lt;li&gt;Porting Remoting to WCF may be a little bit harder &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The setup of the demo solution:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;On Vista: If UAC is enabled, run VS2008 under the Administrator&amp;#39;s credentials &lt;/li&gt;    &lt;li&gt;Install the databases using the provided teched2008.sql script. This installs three databases, one for the ATL based bank, one for the EnterpriseServices based bank, and one for the WCF IMax ticket ordering service. &lt;/li&gt;    &lt;li&gt;The Banks&amp;#39; Databases need some valid accounts, add a client to the CPPBank and a business account to the ESBank. &lt;/li&gt;    &lt;li&gt;On Vista: To host the service in a process that is not run under admin, you need to&amp;#160; execute the CounfigureNetwork.bat batch file (under admin rights) &lt;/li&gt;    &lt;li&gt;Open the solution, Select the target architecture (x64 or x86) and build it. (The x64 version is fully tested, the x86 may need some tweaks in the post build actions) &lt;/li&gt;    &lt;li&gt;After (any time you do it) you reregister one of the COM+ application to the COM+ Catalog, you need to configure the COM+ service. Use the addresses from the endpoint addresses.txt file, otherwise you will have to update the service references of the WCF clients. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The solution:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_7787/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="484" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_7787/image_thumb.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The UI:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_141F3/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="484" alt="image" src="http://blogs.microsoft.co.il/blogs/alon/WindowsLiveWriter/BacktotheFutureSummaryofmylectureatTechE_141F3/image_thumb.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Activate the Services and place an order. To use the WF, check the &amp;quot;Use WF&amp;quot; and activate the host.&lt;/p&gt;  &lt;p&gt;You can download the presentation from &lt;a href="http://blogs.microsoft.co.il/blogs/alon/Back2TheFuture.zip" target="_blank"&gt;here&lt;/a&gt;, and the code from &lt;a href="http://blogs.microsoft.co.il/blogs/alon/ORPC2SOA.zip" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I will be more than happy to get your feedbacks.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=72488" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Teched/default.aspx">Teched</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category></item><item><title>337 - ORPC to SOA or as I call it Back to the Future, Tomorrow morning</title><link>http://blogs.microsoft.co.il/blogs/alon/archive/2008/04/06/337-orpc-to-soa-or-as-i-call-it-back-to-the-future-tomorrow-morning.aspx</link><pubDate>Mon, 07 Apr 2008 02:46:00 GMT</pubDate><guid isPermaLink="false">b5c4f5bc-c09b-4439-a595-91a98c1847df:74738</guid><dc:creator>Alon Fliess</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/rsscomments.aspx?PostID=74738</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.microsoft.co.il/blogs/alon/commentapi.aspx?PostID=74738</wfw:comment><comments>http://blogs.microsoft.co.il/blogs/alon/archive/2008/04/06/337-orpc-to-soa-or-as-i-call-it-back-to-the-future-tomorrow-morning.aspx#comments</comments><description>&lt;p&gt;If you are in Tech-Ed Eilat, remember to come to my lecture on Monday 7/4 at 09:45, Topaz Opel room, Hilton.&lt;/p&gt;
&lt;p&gt;Why do you want to be there:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I will take you to a time travel&lt;/li&gt;
&lt;li&gt;You will see plenty of technologies speak together:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;C++, ATL, COM, COM+, VB Script, C#, Enterprise Services, WCF, Windows WF, .NET Remoting, ASP.NET ASMX &lt;/li&gt;
&lt;li&gt;I use the OLE DB Template technology to access database in ATL&lt;/li&gt;
&lt;li&gt;I Use LINQ to SQL technology to access database in C#&lt;/li&gt;
&lt;li&gt;And I use WPF in my client code!&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;I will show you some real magic&lt;/li&gt;
&lt;li&gt;If you want to move to WCF (.NET 3.x) but keep your current investment you must come and see how.&lt;/li&gt;
&lt;li&gt;If you need to call a service from an existing VB 6.0 or native C++ code with no need to upgrade it, come and see how.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;See you tomorrow!&lt;/p&gt;&lt;img src="http://blogs.microsoft.co.il/aggbug.aspx?PostID=74738" width="1" height="1"&gt;</description><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2B002B00_/default.aspx">C++</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Teched/default.aspx">Teched</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM_2B00_/default.aspx">COM+</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/C_2300_+3.0/default.aspx">C# 3.0</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/COM/default.aspx">COM</category><category domain="http://blogs.microsoft.co.il/blogs/alon/archive/tags/Interop/default.aspx">Interop</category></item></channel></rss>