Ver Mensaje Individual
  #12  
Antiguo 23-08-2012
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Intenta esto:

Código Delphi [-]
const
  CM_AFTERSHOW = WM_USER + 100;

type
  TForm1 = class (TForm)
    ...
    procedure FormCreate(Sender: TObject);
  private
    procedure CMAfterShow(var Message: TMessage); message CM_AFTERSHOW;
  end;

implementation

procedure TForm1.FormCreate(Sender: TObject);
begin
  SetWindowLong(
    ProgressBar1.Handle, GWL_STYLE,
    GetWindowLong(ProgressBar1.Handle, GWL_STYLE) or PBS_MARQUEE);

  PostMessage(Handle, CM_AFTERSHOW, 0, 0);
end;

procedure TForm1.CMAfterShow(var Message: TMessage);
begin
  SendMessage(ProgressBar1.Handle, PBM_SETMARQUEE, 1, 0);

  try
    ZConnection1.Connect;
  finally
    SendMessage(ProgressBar1.Handle, PBM_SETMARQUEE, 0, 0);
  end;
end;

// Saludos
Responder Con Cita