MFC 遮罩(透明)

// Set WS_EX_LAYERED on this window 
SetWindowLong(m_hWnd,GWL_EXSTYLE,
    GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);

// Make this window xx% alpha
SetLayeredWindowAttributes(0, (255 * transparency) / 100, LWA_ALPHA);

放在OnInitDialog即可。

你可能感兴趣的:(MFC 遮罩(透明))