如何在WPF 应用中获取窗体或控件的句柄
窗体:
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;