开发者

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;
   }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜