Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run .avi from form
Message
From
06/12/2005 13:14:56
 
 
To
06/12/2005 12:52:18
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01075416
Message ID:
01075442
Views:
18
Run the program below and when prompted to insert an object, scroll down to the Microsoft Animation Control 6.0 (SP6) and double click on it to install it. When the form displays, click on the Open button and locate an avi file on your hard drive. Then click on the play button.
PUBLIC oform
oform = NEWOBJECT('aviform')
oform.show()

DEFINE CLASS aviform AS form


	DataSession = 2
	Top = 10
	Left = 18
	Height = 353
	Width = 483
	DoCreate = .T.
	ShowTips = .T.
	BufferMode = 2
	Caption = "Animation Control Sample"
	WindowState = 0
	Name = "form1"


	ADD OBJECT commandgroup1 AS commandgroup WITH ;
		ButtonCount = 3, ;
		Value = 1, ;
		Height = 97, ;
		Left = 376, ;
		Top = 14, ;
		Width = 96, ;
		Name = "Commandgroup1", ;
		Command1.Top = 5, ;
		Command1.Left = 5, ;
		Command1.Height = 27, ;
		Command1.Width = 84, ;
		Command1.Caption = "Open", ;
		Command1.ToolTipText = "Selects and Open .AVI Files", ;
		Command1.ForeColor = RGB(255,255,0), ;
		Command1.Name = "Command1", ;
		Command2.Top = 34, ;
		Command2.Left = 5, ;
		Command2.Height = 27, ;
		Command2.Width = 84, ;
		Command2.Caption = "Play", ;
		Command2.ToolTipText = "Plays an .AVI File", ;
		Command2.ForeColor = RGB(128,255,0), ;
		Command2.Name = "Command2", ;
		Command3.Top = 63, ;
		Command3.Left = 5, ;
		Command3.Height = 27, ;
		Command3.Width = 84, ;
		Command3.Caption = "Stop", ;
		Command3.ToolTipText = "Stops an .AVI File", ;
		Command3.ForeColor = RGB(255,0,0), ;
		Command3.Name = "Command3"


	ADD OBJECT olecontrol1 AS olecontrol WITH ;
		Top = 15, ;
		Left = 20, ;
		Height = 325, ;
		Width = 337, ;
		Name = "Olecontrol1"


	PROCEDURE Error
		LPARAMETERS nError, cMethod, nLine
	ENDPROC


	PROCEDURE setenabled
	ENDPROC


	PROCEDURE commandgroup1.Command1.Error
		LPARAMETERS nError, cMethod, nLine
		If nError = 1429
		   MessageBox('This AVI Format is not supported')
		EndIf
		ThisForm.OleControl1.Stop
		ThisForm.OleControl1.Visible = .F.
		This.Parent.Tag = ""
		ThisForm.OleControl1.Close
		ThisForm.OleControl1.Visible = .T.
	ENDPROC


	PROCEDURE commandgroup1.Command1.Click
		ThisForm.OleControl1.Stop
		ThisForm.OleControl1.Visible = .F.
		This.Parent.Tag = ""
		ThisForm.OleControl1.Close
		ThisForm.OleControl1.Visible = .F.
		This.Parent.Tag = GetFile('AVI')
		ThisForm.OleControl1.Close
		If File(This.Parent.Tag)
			ThisForm.OleControl1.Open(This.Parent.Tag)
			ThisForm.OleControl1.Visible = .T.
		ELSE
			ThisForm.OleControl1.Stop
			ThisForm.OleControl1.Visible = .F.
			This.Parent.Tag = ""
			ThisForm.OleControl1.Close
		EndIf
		ThisForm.OleControl1.Visible = .T.
	ENDPROC


	PROCEDURE commandgroup1.Command2.Error
		LPARAMETERS nError, cMethod, nLine
		a = Aerror(b)
		MessageBox(b(2))
		ThisForm.OleControl1.Stop
		ThisForm.OleControl1.Visible = .F.
		This.Parent.Tag = ""
		ThisForm.OleControl1.Close
		ThisForm.OleControl1.Visible = .T.
	ENDPROC


	PROCEDURE commandgroup1.Command2.Click
		ThisForm.OleControl1.Visible = .T.
		ThisForm.OleControl1.Play
	ENDPROC


	PROCEDURE commandgroup1.Command3.Click
		ThisForm.OleControl1.Stop
		ThisForm.OleControl1.Visible = .F.
		This.Parent.Tag = ""
		ThisForm.OleControl1.Close
		ThisForm.OleControl1.Visible = .T.
	ENDPROC


ENDDEFINE
>how to run a video file (.avi) from the form?
>
>regards,
>
>Jerry
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform