Getting the handle of window in C#

前端 未结 3 832
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 13:49

I have the following class declared:

public partial class MainWindow : Window

And I need to get the actual handle of the window once the wi

3条回答
  •  萌比男神i
    2020-12-05 14:46

    In the OnInitialized method the handle has not yet been created. But you are on the right track. If you put your call in the Loaded event the handle will have been created and it should return the correct handle.

提交回复
热议问题