How to make the Win32 APP Background Transparent? in C++ i want to make the background of the program to look like the desktop picture.
Give it the WS_EX_TRANSPARENT extended window style, and handle WM_ERASEBKGND message by doing nothing.
This will make the transparent parts of your window transparent to mouse messages also, if you don't want that, then handle the WM_NCHITTEST message and return HTCLIENT rather than HTTRANSPARENT.
case WM_NCHITTEST:
{
lRet = DefWindowProc(hwnd, uMsg, wParam, lParam);
if (HTTRANSPARENT == lRet)
lRet = HTCLIENT;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.