Good!
cute but really ... the video starts with the main form and should only be activated from the button, then remove suspended the procedure unpacket, not working (ex: SuspendProc ...) ..
ex:
Code:
procedure VideoFormBtnClick(hBtn:HWND);
begin
VideoForm := CreateCustomForm();
with VideoForm do
begin
VideoForm:=CreateCustomForm();
VideoForm.BorderStyle:=bsNone;
VideoForm.ClientWidth:=650;
VideoForm.ClientHeight:=500;
VideoForm.Center;
VideoForm.OnMouseDown:=@VideoFormOnMouseDown;
SetRgn(VideoForm.Handle,'VForm.bmp', 650,500);
VideoFormWizard:=ImgLoad(VideoForm.Handle, ExpandConstant('{tmp}')+'\VForm.png',0,0,650,500,True,True);
ImgApplyChanges(VideoForm.Handle);
VideoFrame:=TForm.Create(nil);
VideoFrame.BorderStyle:=bsNone;
CreateFormFromImage(VideoFrame.Handle,ExpandConstant('{tmp}\VForm.png'));
VideoForm.Left:=VideoFrame.Left;
VideoForm.Top:=VideoFrame.Top;
OldMainProc:=SetWindowLong(VideoForm.Handle, -4, WrapFormCallback(@WizardFormProc5,4));
VideoForm.OnMouseDown:=@VideoFormOnMouseDown;
end;
VideoFormLabel := TLabel.Create(nil);
with VideoFormLabel do
begin
AutoSize := False;
Font.Name := '{#FontName}';
Font.Color := clWhite;
Font.Size := 12;
Parent := VideoForm;
Caption := ExpandConstant('{cm:Button}');
SetBounds(ScaleX(20), ScaleY(460), ScaleX(500), ScaleY(300));
OnMouseDown:=@VideoFormOnMouseDown;
end;
PauseBT:=TBitmapImage.Create(nil);
with PauseBT do begin
SetBounds(ScaleX(150), ScaleY(455), ScaleX(31), ScaleY(30));
Bitmap.LoadFromFile(ExpandConstant('{tmp}\Pause.bmp'));
Parent:=VideoForm;
PauseBT.Hide;
OnClick:=@Pause;
end;
//use switch .png
PlayBT:=TBitmapImage.Create(nil);
with PlayBT do begin
SetBounds(ScaleX(150), ScaleY(455), ScaleX(31), ScaleY(30));
Bitmap.LoadFromFile(ExpandConstant('{tmp}\Play.bmp'));
Parent:=VideoForm;
OnClick:=@Play;
end;
VideoExitBtn:=BtnCreate(VideoForm.Handle,ScaleX(560),ScaleY(455),ScaleX(100),ScaleY(30),ExpandConstant('Button.png'),0,False);
BtnSetEvent(VideoExitBtn,BtnClickEventID,WrapBtnCallback(@VideoExitBtnClick,1));
BtnSetCursor(VideoExitBtn,GetSysCursorHandle(32649));
BtnSetFont(VideoExitBtn,WFButtonFont.Handle);
BtnSetText(VideoExitBtn,'Close');
BtnSetFontColor(VideoExitBtn,$00FFFFFF,$00695E5E,$00FFFFFF,$00695E5E);
ImgApplyChanges(VideoForm.Handle);
ExtractTemporaryFile(ExpandConstant('Video.avi'));
mciSendString('open "'+ ExpandConstant('{tmp}\Video.avi') +'" alias MPEGVideo parent '+ IntToStr(VideoForm.Handle) +' style child','',0,0)
mciSendString('put MPEGVideo window at '+ IntToStr(11) +' '+ IntToStr(10) +' '+ IntToStr(ScaleX(629)) +' '+ IntToStr(ScaleY(439)),'',0,0)
mciSendString('play MPEGVideo repeat','',0,0);
PauseBT.Show;
PlayBT.Hide;
VideoForm.Show;
end;
cancel:
videoplay();
for the buttons of the video can use a switch PNG (no .bmp)
I repeat and very cute this script