Finding the handle to a WPF window

前端 未结 4 1393
庸人自扰
庸人自扰 2020-11-30 00:19

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 Wind

4条回答
  •  一个人的身影
    2020-11-30 00:44

    Well, instead of passing Application.Current.MainWindow, just pass a reference to whichever window it is you want: new WindowInteropHelper(this).Handle and so on.

提交回复
热议问题