Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to use the alpha transparency features included in Windows 2000 and XP Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
29-Aug-02
Category
Win API
Language
Delphi 2.x
Views
90
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas 

How to use the alpha transparency features included in Windows 2000 and XP

Answer:

1   { ... }
2   const
3     WS_EX_LAYERED = $80000;
4     LWA_COLORKEY = 1;
5     LWA_ALPHA = 2;
6   
7   type
8     TSetLayeredWindowAttributes = function(
9       hwnd: HWND; {handle to the layered window}
10      crKey: TColor; {specifies the color key}
11      bAlpha: byte; {value for the blend function}
12      dwFlags: DWORD {action}
13      ): BOOL; stdcall;
14  
15  procedure TfBaseSplash.FormCreate(Sender: TObject);
16  var
17    Info: TOSVersionInfo;
18    F: TSetLayeredWindowAttributes;
19  begin
20    inherited;
21    Info.dwOSVersionInfoSize := SizeOf(Info);
22    GetVersionEx(Info);
23    if (Info.dwPlatformId = VER_PLATFORM_WIN32_NT) and (Info.dwMajorVersion >= 5) then
24    begin
25      F := GetProcAddress(GetModulehandle(user32), 'SetLayeredWindowAttributes');
26      if Assigned(F) then
27      begin
28        SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE)
29          or WS_EX_LAYERED);
30        F(Handle, 0, Round(255 * 80 / 100), LWA_ALPHA);
31      end;
32    end;
33  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC