如何从WPF中临时冻结整个显示

时间:2022-07-15 19:21:38

I'm looking for a way - probably win32 API - to freeze the entire display from within my .Net WPF application.

我正在寻找一种方法 - 可能是win32 API - 从我的.Net WPF应用程序中冻结整个显示。

Reason: Well, this time it's not to annoy users. I basically want to hide some background file operations, who are opening File Save Dialog boxes. Applying the file name is being handled by my app, by simulating keystrokes.

原因:嗯,这次不是为了惹恼用户。我基本上想隐藏一些后台文件操作,他们正在打开文件保存对话框。应用程序正在通过模拟击键来处理文件名。

1 个解决方案

#1


0  

As all the comments are pointing out, this is maybe a terrible design, but you need an answer anyway.

正如所有评论都指出的那样,这可能是一个糟糕的设计,但无论如何你都需要一个答案。

I have done something similar in the past by taking a screenshot and placing it on a window without borders nor title, that uses all the space and is above all other windows.

我过去曾做过类似的事情,截取屏幕并将其放在没有边框或标题的窗口上,它使用了所有空间并且高于所有其他窗口。

#1


0  

As all the comments are pointing out, this is maybe a terrible design, but you need an answer anyway.

正如所有评论都指出的那样,这可能是一个糟糕的设计,但无论如何你都需要一个答案。

I have done something similar in the past by taking a screenshot and placing it on a window without borders nor title, that uses all the space and is above all other windows.

我过去曾做过类似的事情,截取屏幕并将其放在没有边框或标题的窗口上,它使用了所有空间并且高于所有其他窗口。