keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_SNAPSHOT, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
HBITMAP h;
OpenClipboard(NULL);
h = (HBITMAP)GetClipboardData(CF_BITMAP);
CloseClipboard();
...
normally this works well. but if the foreground window changes and locks the clipboard then it can't open clipboard.
Is there any alternative way to capture the screen -that can work in background too-?
thanks,
A simple scheme to capture the screen of monitor 1, that served me well but doesn't cover all corner cases:
Capturing an Image
Could this be what you are looking for? What the example does is basically take a printscreen.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.