用spy++看下,如果没有,就不要尝试获取了。
如果要得到一个Window的handle, 可以用WindowInteropHelper类, 例如: using System.Windows.Interop; // ...... // myDialog is an instance of Window WindowInteropHelper wih = new WindowInteropHelper(myDialog); IntPtr myHandle = wih.Handle Window中嵌入Window貌似不可以. 一般把要嵌入到多个Window去的UI做成UserControl比较好.
using System.Windows.Interop; // ...... // myDialog is an instance of Window WindowInteropHelper wih = new WindowInteropHelper(myDialog); IntPtr myHandle = wih.Handle
17,748
社区成员
24,327
社区内容
加载中
试试用AI创作助手写篇文章吧