C# WPF 获取窗体和控件的句柄

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


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

posted @ 2019-01-14 08:56  探索的动机  阅读(2074)  评论(0编辑  收藏  举报