<p>I'm trying this:</p>

<pre><code>Type ThreadContextType = typeof(Application).GetNestedType("ThreadContext", System.Reflection.BindingFlags.NonPublic);
MethodInfo FDoIdleMi = ThreadContextType.GetMethod("FDoIdle", BindingFlags.NonPublic |
    BindingFlags.Instance, null, new Type[] { typeof(Int32) }, null);
</code></pre>

<p>ThreadContextType is ok but FDoIdleMi is null. I know there is something wrong in the GetMethod call because FDoIdle comes from the UnsafeNativeMethods.IMsoComponent interface.</p>

<p>How to do that? Thanks.</p>

You need to fully-qualify the method name, because they're using explicit interface implementation:
```
```
Type type = typeof( Application ).GetNestedType( "ThreadContext",
    BindingFlags.NonPublic );
MethodInfo doIdle = type.GetMethod(
    "System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle",
    BindingFlags.NonPublic | BindingFlags.Instance );
```
```
For the record, reflecting on non-public members is generally bad practice, but you probably already know that.
EDIT
In the spirit of teaching a person to fish, I figured this out by calling
```
GetMethods(...)
```
on the type object, and examining the returned array to see how the methods were named. Sure enough, the names included the complete namespace specification.