日期:2014-05-17  浏览次数:20828 次

wpf
wpf怎么根据窗口句柄获取窗口(类似于winform的windowformhost)
WPF WinForm

------解决方案--------------------
WPF获取窗口句柄
2011-04-06 09:40 by 翟士丹 Stan Zhai, 209 阅读, 0 评论, 收藏, 编辑
.NET WinForm获取窗口句柄很方便,this.Handle搞定。

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

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

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

this是个Window类的实例
------解决方案--------------------
详细信息看这个介绍:http://www.cnblogs.com/jasondan/archive/2011/04/06/2095984.html