J'essaie ceci:Comment obtenir un MethodInfo dans la classe ThreadContext?
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);
ThreadContextType est ok mais FDoIdleMi est nulle. Je sais qu'il y a un problème dans l'appel GetMethod car FDoIdle provient de l'interface UnsafeNativeMethods.IMsoComponent.
Comment faire? Merci.
J'ai essayé avec UnsafeNativeMethods.IMsoComponent.FDoIdle mais j'ai oublié le préfixe System.Windows.Forms. Merci pour ça. –