有条件地从桌面屏幕截图中隐藏特定窗口
这可能吗?我有三 (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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有大量的工作,这是不可能的。打印屏幕功能只是将桌面 DC 的内容复制到图像并将其放置在键盘上。它实际上不会将整个桌面重新渲染到新的 DC 中。所以它不可能默默地删除特定的窗口。
我想您可以挂钩打印屏幕按钮(或功能,无论它是什么)并允许它在剪贴板上创建图像。然后,您的钩子可以从桌面读取相关窗口的位置,并清除剪贴板上位图的该区域。
您的挂钩将执行以下操作:
当然,假设您可以挂钩打印屏幕功能。我怀疑这是可能的,尽管我从未尝试过。
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:
Assuming, of course, that you can hook the print screen function. I suspect it's possible, although I've never tried it.