Skip to content

Instantly share code, notes, and snippets.

View simulacra-mechatronics's full-sized avatar
🎭
Working on the Report Manager

Praxis simulacra-mechatronics

🎭
Working on the Report Manager
View GitHub Profile
@simulacra-mechatronics
simulacra-mechatronics / main.cpp
Last active May 15, 2024 12:30
Win32 C++ non-rectangular window skin and non-rectangular button skin using SetLayeredWindowAttributes() and SetWindowRgn()
#include <windows.h>
#include <iostream> // Used for outputting info via 'cout' or 'cerr' to debug window
#include "resource.h" // Contains declarations of resources contained in resource file
void DestroyCaption(HWND hwnd, int windowWidth, int windowHeight); // Used to remove window caption and size window to bitmap size
HRGN CreateRgnFromFile(HBITMAP hBmp, COLORREF color); // Function that accepts a bitmap with color keyed to transparency and defines a region according to non transparent area
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); // Get a function pointer
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes; // Set instance of function pointer