窗体:
IntPtr hwnd = new WindowInteropHelper(this).Handle;
控件:
IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(uielement)).Handle;
注:该调用不能在多线程里面使用
窗体:
IntPtr hwnd = new WindowInteropHelper(this).Handle;
控件:
IntPtr hwnd = ((HwndSource)PresentationSource.FromVisual(uielement)).Handle;
注:该调用不能在多线程里面使用
转载于:https://www.cnblogs.com/guiqiang/p/3336436.html