MFC Dialog 透明渐变

    //以下在DialogInit消息中写
SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,    GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000); this->SetTimer(245,100,NULL);
void CLayerWndDlg::OnTimer(UINT_PTR nIDEvent)
{
    // TODO: 在此添加消息处理程序代码和/或调用默认值
    static int i = 0;
    if(nIDEvent == 245)
    {
        SetLayeredWindowAttributes(0,i,2);
        i+=10;
        if(i == 250)
        {
            SetLayeredWindowAttributes(0,255,2);    
            this->KillTimer(nIDEvent);
        }
    }
    CDialogEx::OnTimer(nIDEvent);
}
本人新博客网址为:http://www.hizds.com
本博客注有“转”字样的为转载文章,其余为本人原创文章,转载请务必注明出处或保存此段。c++/lua/windows逆向交流群:69148232
原文地址:https://www.cnblogs.com/zhangdongsheng/p/2812056.html