我想這一點:如何在ThreadContext類中獲取MethodInfo?
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是好,但FDoIdleMi爲空。我知道GetMethod調用有問題,因爲FDoIdle來自UnsafeNativeMethods.IMsoComponent接口。
如何做到這一點?謝謝。
我曾嘗試與UnsafeNativeMethods.IMsoComponent.FDoIdle但忘記了System.Windows.Forms前綴。感謝那。 – 2008-10-18 16:37:54