sleebu
sleebu

Reputation: 11

Making transparent borderless windows with minimize and maximize animations

I want to create a transparent borderless window. By word transparent i mean per-pixel transparency, so it has a transparent background. It has to support minimize and maximize animations.

i tried doing so:

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

DWMNCRENDERINGPOLICY ncrp = DWMNCRP_DISABLED;
DwmSetWindowAttribute( hwnd, DWMWA_NCRENDERING_POLICY, &ncrp, sizeof( ncrp ) );

LRESULT WINAPI WndProc( ... ){
    switch ( msg )
    {
        ...
        case WM_NCCALCSIZE: return 0;
    }
}

but i always get the same problem. non-dwm window border appears for a frame everytime i focus/unfocus the window. here is how it looks.

broken window

removing EX_ styles doesn't fix it.

Upvotes: 0

Views: 104

Answers (0)

Related Questions