exebyte, #include <windows.h> void CaptureScreen(const char* filename) { HDC hScreen = GetDC(NULL); HDC hMemoryDC = CreateCompatibleDC(hScreen); int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen, width, height); HGDIOBJ oldBitmap = SelectObject(hMemoryDC, hBitmap); BitBlt(hMemoryDC, 0, 0, width, height, hScreen, 0, 0, SRCCOPY); SelectObject(hMemoryDC, oldBitmap); DeleteObject(hBitmap); DeleteDC(hMemoryDC); ReleaseDC(NULL, hScreen); } Код #include <windows.h> void CaptureScreen(const char* filename) { HDC hScreen = GetDC(NULL); HDC hMemoryDC = CreateCompatibleDC(hScreen); int width = GetSystemMetrics(SM_CXSCREEN); int height = GetSystemMetrics(SM_CYSCREEN); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen, width, height); HGDIOBJ oldBitmap = SelectObject(hMemoryDC, hBitmap); BitBlt(hMemoryDC, 0, 0, width, height, hScreen, 0, 0, SRCCOPY); SelectObject(hMemoryDC, oldBitmap); DeleteObject(hBitmap); DeleteDC(hMemoryDC); ReleaseDC(NULL, hScreen); }