Reputation: 675
I try to grab specific windows on Windows 10. I read some articles from MSDN to get familiar with APIs. My goal is to grab some certain windows, even if there are some windows on top of them (equivalent to OS X CGWindowList API
). So if there are 2 windows: A
and B
, and windows B
partially overlaps window A
, I would like to be able to capture window A
content, without capturing window B
that partially covers window it.
According to this link, there are 5 different ways to capture the screen, if I understood them correct, most of them can capture only some regions on the screen, i.e. they don't distinguish between windows. The only API which allows to grab specific windows is "old standby, GDI".
I tried to acquire windows' device contexts using GetWindowDC()
function, create a compatible bitmap and then use bit block transfer (BitBlt()
). However, it seems that it does not always work as expected.
I've noticed several problems on Windows 10 (did not test on other operating systems):
msctls_statusbar32msctls_statusbar32
child window of Notepad had the width which was 3 times bigger than the actual width of the window).ApplicationFrameHost.exe
process.Does anyone know how to solve those issues?
Upvotes: 0
Views: 516