How to invoke Application.AddMessageFilter in a Dll
<p>I'd like to create a dll file in C# that has a static method calling Application.AddMessageFilter() on a Win form loading this dll.</p>

<p>For example,</p>

<pre><code>public Form1()
{
    // initializing
    MyDll.InvokeFilter(SomeClass); // Perfect!
}
</code></pre>

<p>And I don't want it to look like as below, (I don't even think that this code would correctly work though)</p>

<pre><code>public Form1()
{
     // initializing

     // Send also the delegate to Application.AddMessageFilter as a parameter
     // to let MyDll know it, which is not as good.
     MyDll.InvokeFilterWithDelegate(SomeClass, Application.AddMessageFilter);
}
</code></pre>

<p>The thing is I don't know how to invoke Application.AddMessageFilter from my Dll file because Application class belongs to Form1, not to my Dll library.</p>

<p>What am I missing? </p>

<p>Thanks in advance.</p>
