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);}
Setting with setwindowlong settings of FORM is Layered Window, then use
SetlayeredWindowAttributes (HWND HWND, ColorRef CRKEY, BYTE BALPHA, DWORD DWFLAGS);
To set the transparent effect, where hwnd is a window handle (form-> handle), CRKEY is a transparent color, if dwflags contains #define lwa_colorKey 0x00000001, you can make the color specified by CRKEY becomes transparent. Balpha is an alpha translucent percentage, and DWFLAGS contains #define lwa_alpha 0x00000002, you can specify a translucent effect, 0 = 0% (full transparent, hidden) 255 = 100% (opaque). In addition, you can use AnimateWindow to make the window fade out. You can check the latest MSDN, or directly see the function definition in the header file of Winuser.h, very simple. (SetlayeredWindowAttribute is not in the Win32API help in BCB, because the help is too old)