Screen capture ignores some windows(屏幕截图忽略了一些窗口)
问题描述
我在 MFC 中工作,我正在尝试捕获桌面的 bmp.我正在使用 GetDC(NULL) 来执行此操作,但它似乎忽略了特殊的蒙皮窗口.它似乎忽略了用 UpdateLayeredWindow 绘制的窗口.这种行为似乎只发生在 Vista x64 和 XP 上.我也试过 GetWindowDC 和桌面 HWND 但结果是一样的.
I am working in MFC and I am trying to capture a bmp of the desktop. I am using GetDC(NULL) to do this but it seems it ignores special skinned windows. It seems to ignore windows drawn with UpdateLayeredWindow. This behaviour seems to be happening only on Vista x64 and XP. I have also tried GetWindowDC with the desktop HWND but the result is the same.
注意事项:1)打印屏幕工作.2) 在 Vista 上,如果我启用 Aero,屏幕截图正常,会出现特殊"窗口.所以在 Vista 上它只在 Aero 被禁用时才会发生.
NOTES: 1) Print Screen works. 2) On Vista if I enable Aero the screen captures are ok, "special" windows appear. So on Vista it only happens when Aero is disabled.
一个想法?
谢谢.
推荐答案
调用BitBlt()时,为捕获"分层窗口添加CAPTUREBLT标志
When calling BitBlt(), add the CAPTUREBLT flag to "capture" layered windows
这篇关于屏幕截图忽略了一些窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:屏幕截图忽略了一些窗口


基础教程推荐
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01