1st type of translucent window // ------------------------------------------ ---------------------- void __fastcall tform1 :: formcreate (TOBJECT * Sender) {long LRT = getWindowlong (Handle, GWL_EXSTYLE); LRT = LRT | WS_EX_LAYERED SetWindowlong (Handle, GWL_EXSTYLE, LRT); setlayeredWindowAttributes (Handle, CLBLUE, 200, LWA_ALPHA);} // --------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Second type
I have long wanted to write an experience in this area. I haven't been free, but this time I am looking for me, I will not shrink my head. In fact, I still have a lot of problems, and I will ask the master here. Published in V-Galaxy BBS, if you want to pay, please contact the author in info@ministars.com
1. Windows 2000 GDI Extension Set Windows 2000 Extension The original GDI instruction set will provide high-efficiency image processing instructions such as Alpha Blending. There is a special window style WS_EX_LAYERED to provide transparent windows in Win2000. Win2000 It also provides an API such as animateWindow (...), directly supports window animation.
Connection
Http://www.microsoft.com/hwdev/video/gdinext.htmhtp://x.wonder.ca/stevex/nthack/
2. Implementation method under Win95 / NT
Since Windows does not provide ready-made, you have to do it yourself. In principle it is:
a. Get the DC of the desktop, generate a compatible Bitmap, send a WM_Paint message, take the desktop to Bitmap. (like a screen capture) b. Draw yourself to another Bitmapc. Use these two ALPHA BLENDING, or other effects, generate the third picture. D. Finally, put the picture Bitblt
It is not difficult to say, but there are several problems in technology.
1. How do I copy the Hidden window to the image? In principle, I can't do it. But I can do some hands and feet in my program. I use the Wizard window in SafeClean Utilities2, I need to get the image before display. Processing again. I use WM_PRINT messages, usually used very little, but you can intercept Z-Order's low window (Hidden is not working). For example, I want to turn it from Page 1 (P1) to the second Page (P2), I have to move P1 to the top before displaying a new window, then display P2 (blocked by P1), send the WM_PRINT message to the P2 to block the picture, and then do the animation, close P1.
2. WM_PRINT problem
WM_PRINT is actually similar to WM_Paint, but can block the part covered by other windows. But not all windows support WM_PRINT, such as Static Control, can only draw them in Bitmap.
3. How to store the window below Bitmap?
To achieve the real icon of the win2000, you must have a picture below the window below it. Whether I don't know if I do it. I use the technology only suitable for Splash Window and Icon Kingsoft. Window. I use the code listed below, because some other classes are involved, are distributed in different places, so it is not complete. For reference only. You can see the Bitmap section of www.codeguru.com, there is good Code. This time is very busy, the school must start the exam, just a rough introduction, please understand.