Feedback

Handle eines WPF Fensters ermitteln

Sprache: C#

Handle eines WPF Fensters ermitteln
1. HwndSource source = (HwndSource)HwndSource.FromVisual(this);
source.Handle ..

bzw.

2. IntPtr windowHandle = new WindowInteropHelper(
    Application.Current.MainWindow).Handle;
1. HwndSource source = (HwndSource)HwndSource.FromVisual(this);
source.Handle ..

bzw.

2. IntPtr windowHandle = new WindowInteropHelper(
    Application.Current.MainWindow).Handle;