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
这篇关于屏幕截图忽略了一些窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:屏幕截图忽略了一些窗口
基础教程推荐
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- CString 到 char* 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 初始化列表*参数*评估顺序 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
