如何对被遮盖的窗口截图
正常情况下,GetWindowDC(hwnd);然后BitBlt可以截图。如果这个窗口被其它窗口遮盖,又该如何截图呢?
网上很多资料说使用PrintWindow这个未公开的函数。想找到有没有其它的办法解决这个问题。
[解决办法]
PrintWindow非未公开的函数,参见msdn http://msdn.microsoft.com/en-us/library/dd162869(VS.85).aspx
[解决办法]
学习
[解决办法]
PrintWindow是公开的函数,XP以上系统才有。以下摘自MSDN。
PrintWindow
The PrintWindow function copies a visual window into the specified device context (DC), typically a printer DC.
BOOL PrintWindow(
HWND hwnd, // Window to copy
HDC hdcBlt, // HDC to print into
UINT nFlags // Optional flags
);
Parameters
hwnd
Handle to the window that will be copied.
hdcBlt
Handle to the device context.
nFlags
Specifies the drawing options. It can be one of the following values. Value Meaning
PW_CLIENTONLY Only the client area of the window is copied to hdcBlt. By default, the entire window is copied.
Return Values
If the function succeeds, it returns a nonzero value.
If the function fails, it returns zero.
[解决办法]
窗口句柄已获得,那么可以置顶后截屏,然后置后。
[解决办法]
http://www.fengyuan.com/article/wmprint.html
[解决办法]
上来学习。。
[解决办法]
窗口句柄已获得,那么可以置顶后截屏,然后置后。赞同.
[解决办法]
关注.
[解决办法]
[解决办法]
[解决办法]
学习
[解决办法]
如LZ所说,可以使 窗口 置最顶(SetForegroundWindow)之后截屏,不过俺没试过,LZ可以试一试!
[解决办法]
up
[解决办法]
bringtotop后再进行截图
[解决办法]
踩脚,留个记号。
[解决办法]
[解决办法]
VISTA以前的系统,不好办。当被遮盖之后,被遮盖的部分就已经是clip region之外了,根本不会画出来。要么有什么未公开的API,要么就将窗口置顶,然后再截屏。
VISTA以后的系统引入了DWM,所有的窗口都是画到了directx的一个surface上,所以VISTA任务栏上可以随时显示窗口缩略图。