VC毛玻璃
代码说明:
#define GDIPVER 0x0110 //定义高版本的GDI+(1.1) #include #include #include #include #include #pragma comment(lib,"GdiPlus.lib") using namespace Gdiplus; #include #pragma comment(lib,"dwmapi.lib") //Aero效果是否已启用 BOOL IsCompositionEnabled() { BOOL bEnabled,bResult; bResult = (SUCCEEDED(DwmIsCompositionEnabled(&bEnabled)) && bEnabled); return bResult; } //对已分层的窗口启动玻璃效果 HRESULT EnableBlurBehindWindow(HWND hWnd, //窗口句柄 BOOL bEnable = TRUE, //启用或禁用 HRGN hRgn = 0, //模糊窗体中某个区域 BOOL bTransitionOnMaximized = FALSE) //最大化时是否启用 { DWM_BLURBEHIND blurBehind = { 0 }; blurBehind.dwFlags = DWM_BB_ENABLE | DWM_BB_TRANSITIONONMAXIMIZED; blurBehind.fEnable = bEnable; blurBehind.fTransitionOnMaximized = bTransitionOnMaximized; if (bEnable && hRgn != NULL) { blurBehind.dwFlags |= DWM_BB_BLURREGION; blurBehind.h
下载说明:请别用迅雷下载,失败请重下,重下不扣分!