Finding the handle to a WPF window

前端 未结 4 1390
庸人自扰
庸人自扰 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:55

    If you want window handles for ALL of your application's Windows for some reason, you can use the Application.Windows property to get at all the Windows and then use WindowInteropHandler to get at their handles as you have already demonstrated.

提交回复
热议问题