Created
September 21, 2016 15:26
-
-
Save ioncodes/fb677ed4f8cf9fa7fd5749c6c948dc6e to your computer and use it in GitHub Desktop.
Header to set the transparency of your console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
inline BOOL WindowTransparency(HWND hwnd, BYTE bAlpha) | |
{ | |
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED); | |
SetLayeredWindowAttributes(hwnd, RGB(255, 255, 255), bAlpha, 2); | |
return true; | |
} | |
inline VOID SetTransparency(int transparency) | |
{ | |
HWND consoleWnd = GetConsoleWindow(); // Get the handle | |
WindowTransparency(consoleWnd, transparency); // Set the transparency | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment