Loading a WPF Window without showing it

前端 未结 12 806
独厮守ぢ
独厮守ぢ 2020-12-12 16:14

I create a global hot key to show a window by PInvoking RegisterHotKey(). But to do this I need that window\'s HWND, which doesn\'t exist until the

12条回答
  •  爱一瞬间的悲伤
    2020-12-12 16:38

    Another option in a similar vein to setting the opacity to 0, is to set the size to 0 and set the position to be off the screen. This won't require the AllowsTransparency = True.

    Also remember that once you have shown it once you can then hide it and still get the hwnd.

提交回复
热议问题