The Layeredwindow is available in two different modes:
1. Use SetLayeredWindowAttributes to set the transparency, complete the window's unified transparency, the window still receives the paint message, other applications like normal window.
2. Using the Updatelayeredwindow method, to the system to submit a DC containing bitmap, to the system unified management, at this time no longer receive the paint message, any changes to the window can only be modified by Updatelayeredwindow.
If you don't need to have different transparency for the pixel level, just use the setlayeredwindowattributes mode, as with normal window usage, the system caches the bitmap of the window, so when the other windows on the window are moved away, This is where the system will go to draw itself and will not send the paint message. With the benefit of this pattern, you basically don't have to change the way you use the window, and after you receive the paint message, the drawn image is redirected to another function, which is combined to get a transparent effect.
If you need to achieve different levels of transparency for the pixel level, or if you want to control the drawing of the window more directly, you must use the Updatelayeredwindow method, which does not redirect your drawing results, nor does it cache the window's bitmap, but it is entirely up to you to draw, This is more efficient in terms of memory.
1. Once you call the Setlayeredwindowattributes,updatelayeredwindow call will fail, you need to reset the ws_ex_layered, which is the key to the two mode switching. The 2.ws_ex_layered property is not set to child Windows 3. In a completely transparent place, the mouse click will be passed through, and if the Ws_ex_transparent property is set on the window, the mouse message will also pass through
The DM uses the following method to implement the Updatelayeredwindow window to receive the paint message:
Http://hgy413.com/1865.html
dui-layered windows two modes (SetLayeredWindowAttributes and Updatelayeredwindow two methods each have pros and cons)