About the display of transparent windows

Source: Internet
Author: User

1th Kind

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);
}
//-----------------------------------------------------------------

2nd Kind

I have long wanted to write a piece of my experience, has been very busy not empty, but this call me, it is not good again fainthearted.

In fact, I also have a lot of problems have not been resolved, here also to master advice.

This article in V-galaxy BBS published, if you want to paste, please contact the author info@ministars.com

1. Windows 2000 's GDI + expansion set

Windows 2000 internally expands the original GDI instruction set, providing efficient image processing instructions such as alpha blending. There is a special window style in Win2000 that ws_ex_layered provide a transparent window. WIN2000 also offers such as AnimateWindow (...) A class of APIs that directly support window animations.

About connections

Http://www.microsoft.com/hwdev/video/GDInext.htm

http://x.wonder.ca/stevex/nthack/

2. The implementation method under Win95/nt

Since Windows doesn't offer ready-made, it has to do it by itself. In principle this is the process:

A. Get the desktop DC, generate a compatible bitmap, send a WM_PAINT message, and take the desktop to bitmap. (Just like a screen Capture)

B. Draw the window you want to open to another picture bitmap

C. Use these two pictures to do alpha blending, or other effects, to generate a third picture.

D. Finally bitblt the picture out

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.