.NET WinForm获取窗口句柄很方便,this.Handle搞定。

WPF就有些麻烦了,获取方法如下:

引入命名空间:using System.Windows.Interop;

获取方法:new WindowInteropHelper(this).Handle

this是个Window类的实例

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-12-30
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-08
  • 2021-12-27
  • 2021-12-12
相关资源
相似解决方案