API (WGC) - черные экранисты. class = "lang-cpp prettyprint-override">
Код: Выделить всё
// From main.cpp - Core screenshot logic using GDI BitBlt
bool CaptureScreenAndSave(const std::wstring& filename) {
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
int screenHeight = GetSystemMetrics(SM_CYSCREEN);
HDC hScreenDC = GetDC(NULL);
HDC hMemoryDC = CreateCompatibleDC(hScreenDC);
HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC, screenWidth, screenHeight);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemoryDC, hBitmap);
// This is the line that 'company.exe' likely interferes with:
if (!BitBlt(hMemoryDC, 0, 0, screenWidth, screenHeight, hScreenDC, 0, 0, SRCCOPY)) {
// Error handling and cleanup...
std::wcerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79642722/screen-capture-blocked-gdi[/url]