hrgn rgnclient = createrectrgnindirect(&rcclient);
hrgn rgnvideo = createrectrgnindirect(&g_rcdest);
combinergn(rgnclient, rgnclient, rgnvideo, rgn_diff);
// paint on window.
hbrush hbr = getsyscolorbrush(color_btnface);
fillrgn(hdc, rgnclient, hbr);
// clean up.
deleteobject(hbr);
deleteobject(rgnclient);
deleteobject(rgnvideo);
// request the vmr to paint the video.
hresult hr = g_pwc->repaintvideo(hwnd, hdc);
}
else // there is no video, so paint the whole client area.
{
fillrect(hdc, &rc2, (hbrush)(color_btnface + 1));
}