8
8
#include < memory>
9
9
10
10
#define MAX_LOADSTRING 100
11
+ #define ALPHA_PERCENT 92
12
+ #define BLOCKOUT_COLOR RGB (0 , 0 , 0 )
11
13
12
14
// Global Variables:
13
15
HINSTANCE hInst; // current instance
@@ -75,7 +77,7 @@ ATOM RegisterClass(HINSTANCE hInstance)
75
77
wcex.hInstance = hInstance;
76
78
wcex.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_BLOCKOUT));
77
79
wcex.hCursor = LoadCursor (nullptr , IDC_ARROW);
78
- wcex.hbrBackground = CreateSolidBrush (RGB ( 0 , 0 , 0 ) );
80
+ wcex.hbrBackground = CreateSolidBrush (BLOCKOUT_COLOR );
79
81
wcex.lpszMenuName = MAKEINTRESOURCEW (IDC_BLOCKOUT);
80
82
wcex.lpszClassName = szWindowClass;
81
83
wcex.hIconSm = LoadIcon (wcex.hInstance , MAKEINTRESOURCE (IDI_BLOCKOUT));
@@ -90,7 +92,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
90
92
hInst = hInstance; // Store instance handle in our global variable
91
93
92
94
HWND hWnd = CreateWindowExW (
93
- WS_EX_TOPMOST, // dwExStyle
95
+ WS_EX_LAYERED | WS_EX_TOPMOST, // dwExStyle
94
96
szWindowClass, // lpClassName
95
97
szTitle, // lpWindowName
96
98
WS_TILEDWINDOW |
@@ -110,6 +112,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
110
112
return FALSE ;
111
113
}
112
114
115
+ SetLayeredWindowAttributes (hWnd, 0 , (255 * ALPHA_PERCENT) / 100 , LWA_ALPHA);
116
+
113
117
ShowWindow (hWnd, nCmdShow | nCmdShow);
114
118
UpdateWindow (hWnd);
115
119
0 commit comments