Solved

Transparent SplashScreen

Posted on 1999-01-04
7
212 Views
Last Modified: 2010-04-04
Hello And Happy New Year!!!

How Can I Make Transparent SplashScreen?
0
Comment
Question by:mummi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Expert Comment

by:heathprovost
ID: 1354524
add the following to your splashscreen form, this will make the window itself transparent.  Not sure if this is what you want though.

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
    procedure CreateParams(var Params: TCreateParams); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  Inherited CreateParams(Params);
  Params.ExStyle := Params.ExStyle + WS_EX_TRANSPARENT;
end;

end.
0
 

Expert Comment

by:tleforge
ID: 1354525
You may also want to try the following code.  It's been passed
around quite frequently lately.  Try it.  I think you'll be
impressed.

//**************************************************************
//**** Code Begins Here ****************************************
//**************************************************************

unit Unit1;

interface

uses  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, Buttons, ComCtrls, Grids, DBGrids;
type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    ListBox1: TListBox;
    ComboBox1: TComboBox;
    DBGrid1: TDBGrid;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure TransForm(Sender: TObject);
    procedure FormResize(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.TransForm(Sender: TObject);
var
  FullRgn, ClientRgn, ButtonRgn: THandle;
  Margin, x, y, z: Integer;
  l,t,h,w: Integer;
begin
  Margin := (Width - ClientWidth) div 2;
  FullRgn := CreateRectRgn(0, 0, Width, Height);
  x := Margin;
  y := Height - ClientHeight - Margin;
  ClientRgn := CreateRectRgn(x, y, x + ClientWidth, y + ClientHeight);
  CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
  for z := ComponentCount - 1 downto 0 do begin
    if Components[z] is {TControl} TWinControl then
      if (Components[z].GetParentComponent is TForm) then
      with Components[z] as {TControl} TWinControl do begin
        l := Left;
        t := Top;
        h := Height;
        w := Width;
      end;
      x := Margin + l;
      y := (Height - ClientHeight - Margin) + t;
    ButtonRgn := CreateRectRgn(x, y, x + w, y + h);
    CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
  end;
  SetWindowRgn(Handle, FullRgn, TRUE);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TransForm(Sender);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Close;
end;

procedure TForm1.FormResize(Sender: TObject);
begin
  TransForm(Sender);
end;

end.

//**************************************************************
//**** Code Ends Here ******************************************
//**************************************************************

0
 
LVL 5

Expert Comment

by:heathprovost
ID: 1354526
you should except tlrforge's comment over mine, much more complete answer.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:tleforge
ID: 1354527
Actually, I'm not asking for any points.  The code segment I
submitted is not completely original.  I did make a few
improvements, but nothing that warrants any points.

0
 
LVL 1

Accepted Solution

by:
adeng earned 40 total points
ID: 1354528
Try to download a cool form in http://www.lawrenz.com/coolform/

it make a transparent form very easy from a picture, it's inculding source code for delphi.

Adeng.
0
 

Expert Comment

by:joanita
ID: 1354529
Include the following code in the onCreate event handler of the splash screen form:
BorderStyle := bsNone;
brush.style :=bsClear;
Additionally if you want the image itself of the splash screen to be tranparent set its transparent property to true.

0
 

Author Comment

by:mummi
ID: 1354530
Yesssss....Thanks..
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question