屏幕捕获特定窗口 [英] Screen Capture Specific Window
本文介绍了屏幕捕获特定窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以截取特定窗口(也可能是另一个进程)?
Is it possible to screen capture a specific window (also possibly of another process)?
目前我正在捕获特定显示器的整个桌面,真正想要的是捕获特定窗口的内容(不管它的位置)。
Currently I am capturing the entire desktop of a specific monitor, however what I truly want is to capture the content of a specific window (regardless of its position).
推荐答案
所有你需要的是获取处理窗口你要捕获和使用WinAPI函数PrintWindow例如:
Yes it is. All what you need is get handle to window which you want to capture and use WinAPI function PrintWindow for example:
// Get the window handle of calculator application.
HWND hWnd = ::FindWindow( 0, _T( "Calculator" ));
// Take screenshot.
PrintWindow( hWnd, getDC(hWnd), 0 );
这里有PrintWindow文档。
Here you have PrintWindow documentation.
这篇关于屏幕捕获特定窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文