Guest User

Untitled

a guest
Feb 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. #include <windows.h>
  2.  
  3.  
  4.  
  5.  
  6. void SetWindowBlur(HWND hWnd)
  7. {
  8. const HINSTANCE hModule = LoadLibrary(TEXT("user32.dll"));
  9. if (hModule)
  10. {
  11. struct ACCENTPOLICY
  12. {
  13. int nAccentState;
  14. int nFlags;
  15. int nColor;
  16. int nAnimationId;
  17. };
  18. struct WINCOMPATTRDATA
  19. {
  20. int nAttribute;
  21. PVOID pData;
  22. ULONG ulDataSize;
  23. };
  24. typedef BOOL(WINAPI*pSetWindowCompositionAttribute)(HWND, WINCOMPATTRDATA*);
  25. const pSetWindowCompositionAttribute SetWindowCompositionAttribute = (pSetWindowCompositionAttribute)GetProcAddress(hModule, "SetWindowCompositionAttribute");
  26. if (SetWindowCompositionAttribute)
  27. {
  28. ACCENTPOLICY policy = { 3, 0, 0, 0 }; // ACCENT_ENABLE_BLURBEHIND=3...
  29. WINCOMPATTRDATA data = { 19, &policy, sizeof(ACCENTPOLICY) }; // WCA_ACCENT_POLICY=19
  30. SetWindowCompositionAttribute(hWnd, &data);
  31. }
  32. FreeLibrary(hModule);
  33. }
  34. }
  35.  
  36.  
  37. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, LPSTR pCmdLine, int nCmdShow)
  38. {
  39.  
  40. HWND taskbar = FindWindow(L"Shell_TrayWnd", NULL);
  41.  
  42.  
  43. while (true) {
  44. SetWindowBlur(taskbar); Sleep((DWORD)10);
  45. }
  46.  
  47. }
Add Comment
Please, Sign In to add comment