PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
Top = -2
Left = 0
Height = 85
Width = 360
ShowWindow = 2
DoCreate = .T.
Caption = "Progress Bar"
Name = "Form1"
AutoCenter = .T.
ADD OBJECT oleprogress AS olecontrol WITH ;
Top = 30, ;
Left = 30, ;
Height = 25, ;
Width = 300, ;
Name = "oleProgress", ;
OleClass = "COMCTL.ProgCtrl.1"
Add Object Timer1 as Timer WITH;
Interval=30, ;
Enabled=.T.
PROCEDURE Init()
#Define GWL_STYLE -16
#Define WM_USER 0x0400
#Define WS_VISIBLE 0x10000000
#Define WS_CHILD 0x40000000
#Define PBM_SETRANGE 0x0401
#Define PBM_SETPOS 0x0402
#Define PBM_DELTAPOS 0x0403
#Define PBM_SETSTEP 0x0404
#Define PBM_STEPIT 0x0405
#Define PBM_SETRANGE32 0x0406
#Define PBM_GETRANGE 0x0407
#Define PBM_GETPOS 0x0408
#Define PBM_SETBARCOLOR 0x0409
#Define PBM_SETBKCOLOR 0x2001
#Define PBM_SETMARQUEE 0x040A
#Define PBM_GETSTEP 0x040D
#Define PBM_GETBKCOLOR 0x040E
#Define PBM_GETBARCOLOR 0x040F
#Define PBM_SETSTATE 0x0410
#Define PBM_GETSTATE 0x0411
#Define PBS_SMOOTH 0x01
#Define PBS_VERTICAL 0x04
#Define PBS_MARQUEE 0x08
#Define PBS_SMOOTHREVERSE 0x10
#Define PBST_NORMAL 0x0001
#Define PBST_ERROR 0x0002
#Define PBST_PAUSED 0x0003
LOCAL lnStyle, lnReturn, lnState
Declare Integer SendMessage In user32 Integer, Integer, Integer, Integer
Declare Integer SetWindowLong In WIN32API Integer, Integer, Integer
m.lnStyle = Bitor(WS_CHILD, WS_VISIBLE, PBS_MARQUEE)
SetWindowLong(This.oleProgress.Object.HWnd, GWL_STYLE, m.lnStyle)
* SendMessage(This.oleProgress.Object.HWnd, PBM_SETMARQUEE, 1, 30) && does not work in Win7
EndProc
Procedure Timer1.Timer()
Thisform.oleprogress.Value=0
ENDPROC
ENDDEFINE