在winform中获取窗口句柄很简单,this.Handle。但在wpf中这个有点麻烦。

窗体: 
IntPtr hwnd = new WindowInteropHelper(this).Handle;


控件: 
IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(uielement)).Handle;

相关文章:

  • 2021-12-15
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案