有条件地从桌面屏幕截图中隐藏特定窗口

发布于 2024-11-03 10:41:07 字数 250 浏览 3 评论 0原文

这可能吗?我有三 (3) 个窗口:

  • Window1 - 不活动
  • Window2 - 不活动
  • Window3 - 活动

如果我截取桌面的屏幕截图,我希望 Window3 安静地隐藏。如果用户使用 Window3,则程序不得以任何方式隐藏窗口,例如最小化窗口或任何其他内容。简而言之,我需要一种不引人注目的方法来从桌面屏幕截图中隐藏特定窗口。

Is this possible. I have three (3) windows:

  • Window1 - not active
  • Window2 - not active
  • Window3 - active

If I take the screenshot of the desktop I want Window3 to be hidden quietly. Provided the user is using Window3 the program must not in any way hide the windows like minimizing it or anything. In short, I need an unobtrusive way of hiding specific windows from desktop screenshot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

当梦初醒 2024-11-10 10:41:07

如果没有大量的工作,这是不可能的。打印屏幕功能只是将桌面 DC 的内容复制到图像并将其放置在键盘上。它实际上不会将整个桌面重新渲染到新的 DC 中。所以它不可能默默地删除特定的窗口。

我想您可以挂钩打印屏幕按钮(或功能,无论它是什么)并允许它在剪贴板上创建图像。然后,您的钩子可以从桌面读取相关窗口的位置,并清除剪贴板上位图的该区域。

您的挂钩将执行以下操作:

call the normal print screen function
load image from clipboard
get location and size of Window3 from desktop
fill that rectangle in the image with black (or whatever)
put the modified image back on the clipboard

当然,假设您可以挂钩打印屏幕功能。我怀疑这是可能的,尽管我从未尝试过。

That's not going to be possible without quite a bit of work. The print screen functionality just copies the contents of the desktop DC to an image and places it on the keyboard. It doesn't actually re-render the whole desktop into a new DC. So there's no way that it can silently remove a particular window.

I suppose you could hook the print screen button (or the function, whatever it is) and allow it to create the image on the clipboard. Then your hook could read the location of the window in question from the desktop and clear out that area of the bitmap that's on the clipboard.

Your hook would do this:

call the normal print screen function
load image from clipboard
get location and size of Window3 from desktop
fill that rectangle in the image with black (or whatever)
put the modified image back on the clipboard

Assuming, of course, that you can hook the print screen function. I suspect it's possible, although I've never tried it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文