Finding the handle to a WPF window
问题 Windows forms had a property win1.Handle which, if I recall, returns the handle of the main window handle? Is there an equivalent way to get the handle of a WPF Window? I found the following code online, IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; but I don't think that will help me because my application has multiple windows. Thanks!! 回答1: Well, instead of passing Application.Current.MainWindow , just pass a reference to whichever window it is you