Josh Posted January 1 Share Posted January 1 This is how I make transparent window effects: // Enable transparency effects #ifdef _WIN32 auto hwnd = window->GetHandle(); struct ACCENTPOLICY { int na; int nf; int nc; int nA; }; struct WINCOMPATTRDATA { int na; PVOID pd; ULONG ul; }; const HINSTANCE hm = LoadLibraryW(L"user32.dll"); if (hm) { typedef BOOL(WINAPI* pSetWindowCompositionAttribute)(HWND, WINCOMPATTRDATA*); const pSetWindowCompositionAttribute SetWindowCompositionAttribute = (pSetWindowCompositionAttribute)GetProcAddress(hm, "SetWindowCompositionAttribute"); if (SetWindowCompositionAttribute) { ACCENTPOLICY policy = { 4, 0, 155, 0 }; //ACCENTPOLICY policy = { 3, 0, 0, 0 }; // and even works 4,0,155,0 (Acrylic blur) WINCOMPATTRDATA data = { 19, &policy,sizeof(ACCENTPOLICY) }; SetWindowCompositionAttribute(hwnd, &data); } FreeLibrary(hm); } #endif You probably want to set your interface's background panel color to 0,0,0,1 for best results. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.