Я пытаюсь запечатлеть скриншоты в C ++ (VS Code 2022, Windows), используя Alt+ T. Мое приложение захватывает экран, но когда компания. Мне сказали, что Company.Exe AlscreEncapture: False.
Методы, пробованные (все, что не удалось против компании. Изображение.
Код: Выделить всё
// 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]