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 Add a drop shadow to your app under 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
21-Jan-03
Category
System
Language
Delphi 2.x
Views
153
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

Add a drop shadow to your app under XP

Answer:

Heres a nice way of adding a drop shadow to your application under Windows XP.

1   unit Unit1;
2   
3   interface
4   
5   uses
6     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
7   
8   type
9     TForm1 = class(TForm)
10    private
11      { Private declarations }
12    public
13      { Public declarations }
14    protected
15      procedure CreateParams(var Params: TCreateParams); override; // Important !
16    end;
17  
18  var
19    Form1: TForm1;
20  
21  implementation
22  
23  {$R *.DFM}
24  
25  {------------------------------------------------------------}
26  // Here we check of the user is running Windows XP
27  
28  function IsWinXP: Boolean;
29  begin
30    Result := (Win32Platform = VER_PLATFORM_WIN32_NT) and
31      (Win32MajorVersion >= 5) and (Win32MinorVersion >= 1);
32  end;
33  {------------------------------------------------------------}
34  
35  {------------------------------------------------------------}
36  // Check if it is Windows XP if all is OK then create the drop shadow
37  
38  procedure TForm1.CreateParams(var Params: TCreateParams);
39  const
40    CS_DROPSHADOW = $00020000;
41  begin
42    inherited;
43    if IsWinXP then
44      Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW
45    else
46  end;
47  {------------------------------------------------------------}
48  
49  end.


This code also checks if it is running under Windows XP, if it is you get the drop shadow if not it does nothing.

			
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