so I’m trying to create a custom overlay.
I’m trying to set the background transparency with DwmExtendFrameIntoClientArea as the LWA_COLORKEY flag has a lot of performance issues.
But for me it just shows my overlay on a black image/screen, on windows 11.
Anyone an idea? Code:
WNDCLASSEXW wc = { sizeof(wc), CS_VREDRAW | CS_HREDRAW, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"Example", NULL };
::RegisterClassExW(&wc);
HWND hwnd = ::CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_LAYERED, wc.lpszClassName, L"Example", WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, wc.hInstance, NULL);
SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 255, LWA_ALPHA);
MARGINS margin = { -1 };
DwmExtendFrameIntoClientArea(hwnd, &margin);