Transparent window

Hi, I am trying to make a transparent window, so the objects in the scene will display on top of windows. Take a look at this:
This is how it looks if I use that code:

Anyone know how to fix this? Thankyou

1 Like

This works:

    const auto hwnd = GetActiveWindow();

    if (hwnd)
        SetWindowLongPtr(hwnd, GWL_STYLE, WS_VISIBLE);

        RECT rect;
        GetWindowRect(hwnd, &rect);
        SetWindowPos(hwnd, HWND_TOPMOST, rect.left,, rect.right - rect.left, rect.bottom -, SWP_SHOWWINDOW);

        const MARGINS margins{ -1 };
        DwmExtendFrameIntoClientArea(hwnd, &margins);

Remove WS_EX_LAYERED if you don’t want click-through

1 Like

Thankyou very much!