How to make the Win32 APP Background Transparent?
How to make the Win32 APP Background Transparent? in C++ i want to m开发者_高级运维ake 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;
}
精彩评论