Ver Mensaje Individual
  #10  
Antiguo 26-04-2007
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 27
Caral Va por buen camino
Hola
Bueno que tal esto:
Creas una nueva aplicacion, colocas un boton, un timer, cuatro labels.
Eliminas todo del unit y colocas el codigo completo que esta abajo.
Tienes que colocar los eventos, osea darle un click al boton, un click al label1 un click al onformshow y destroy, fijate bien, la unica manera de salir del programa sera dando click sobre el label1.
Puedes darle el color y formato que quieras a los label.
Bueno como dice Roman, que me perdone tu papa.
Va:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Timer1: TTimer;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
   // La posicion del label que estamos dibujando (de 1..9)
    _labelActual:Integer;
    { Private declarations }
    procedure CreateParams(var Params: TCreateParams); override;


  public
    { Public declarations }
  end;

  // Define una lista de posiciones
  labelPosition = array[1..20] of integer;

const
  // Amarillo
  POSITION_lab1X:labelPosition = (1152,1144,1040,992,904,856,768,728,640,592,512,472,392,352,280,240,160,120,48,16);
  POSITION_lab1Y:labelPosition = (216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216,216);
  // Violeta
  POSITION_lab2X:labelPosition = (1152,1144,1040,992,904,856,768,728,640,592,512,472,392,352,280,240,160,120,48,16);
  POSITION_lab2Y:labelPosition = (304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304,304);
  // Rojo
  POSITION_lab3X:labelPosition = (1152,1144,1040,992,904,856,768,728,640,592,512,472,392,352,280,240,160,120,48,16);
  POSITION_lab3Y:labelPosition = (248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248);

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.CreateParams(var Params: TCreateParams);
 begin
 inherited CreateParams(Params);
 with Params do
 Style := (Style or WS_POPUP) and not WS_DLGFRAME;

 end;

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

end;

procedure TForm1.Label1Click(Sender: TObject);
begin
   Button1.Perform(WM_LButtonDown,0,0);
   Sleep(250);
   Button1.Perform(WM_LButtonUp,0,0);


end;

procedure TForm1.FormShow(Sender: TObject);
begin
 Form1.Align:= alClient;
 Form1.Color:= clActiveCaption;
 Button1.Visible:= False;
 Label1.Caption:= 'Falla grave  Microsoft ....................................';
 Label2.Caption:= 'Este ordenador esta por fallar';
 Label4.Caption:= 'Necesita memoria urgente';
 Label3.Caption:= 'Que papa, me la compra?';
 //Esconde Barra de inicio
     ShowWindow(FindWindow
    ('Shell_TrayWnd',nil), SW_HIDE) ;

end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  total:Integer;
begin

  // Que pez estamos dibujando
  _labelActual := _labelActual + 1;
  total := Length(POSITION_lab1X);

  // Se ha acabado?
  if (_labelActual > total) then begin
     _labelActual:= 0;
  {  TimerAnim.Enabled := False;
    I1.Visible := False;
    IV1.Visible := False;
    IR1.Visible := False;
    // Sacar el Main
    //...

   Exit;}
  end
  else begin
    // Amarillo
    label2.Visible := True;
    label2.Transparent := True;
    label2.Left := POSITION_lab1X[_labelActual];
    label2.Top := POSITION_lab1Y[_labelActual];
    // Violeta
    label3.Visible := True;
    label3.Transparent := True;
    label3.Left := POSITION_lab2X[_labelActual];
    label3.Top := POSITION_lab2Y[_labelActual];
    // Rojo
    label4.Visible := True;
    label4.Transparent := True;
    label4.Left := POSITION_lab3X[_labelActual];
    label4.Top := POSITION_lab3Y[_labelActual];


end;
  end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
   //Muestra Barra de inicio
     ShowWindow(FindWindow
    ('Shell_TrayWnd',nil), SW_SHOWNA) ;
end;

end.
Este codigo es en parte aporte de mis Maestros del foro.
Saludos
Responder Con Cita