unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 =
class(TForm)
ProgressBar1: TProgressBar;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
const
PBS_MARQUEE = $08;
PBM_SETMARQUEE = wm_user +10;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
cs: longint;
begin
cs := getwindowlong(progressbar1.Handle, gwl_style);
setwindowlong(progressbar1.Handle, gwl_style, cs
or PBS_MARQUEE);
sendmessage(progressbar1.Handle, PBM_SETMARQUEE, 1, 40);
form1.DoubleBuffered := true;
end;