这是一个法国的网站,这是一篇开于如何将ocx加入资源的,是FLASH相半(0分)

L

laohe

Unregistered / Unconfirmed
GUEST, unregistred user!
http://www.clubedelphi.com.br/artigos/flash.html

主要为了报答朋友对我的支持,以前在这个地方问了很多问题,其主要内容如下:

SHOCKWAVEFILE RCDATA arquivo.swf
SHOCKWAVEOCX RCDATA swflash.ocx


No Evento OnCreate do formulário insira o seguinte código:

procedure TfrmMain.FormCreate(Sender: TObject);
var
SystemDir : array[0..MAX_PATH] of Char;
SWFDir, AppDir: String;
Fres: TResourceStream;
Ffile: TFileStream;
begin
GetSystemDirectory(@SystemDir,MAX_PATH);
SWFDir := SystemDir+'/macromed/flash/';
GetDir(0,AppDir);
if fileexists(SWFDir+'swflash.ocx')=false then
begin
{$i-}
MkDir(SystemDir+'/macromed');
MKDir(SystemDir+'/macromed/flash');
{$i+}
Fres := TResourceStream.Create(0,'SHOCKWAVEOCX',RT_RCDATA);
Ffile := TFileStream.Create(SWFDir+'swflash.ocx',fmCreate);
try
Ffile.CopyFrom(Fres,Fres.Size);
finally
Fres.Free;
Ffile.Free;
end;
Winexec(PChar('regsvr32 /s'+SWFDir+'swflash.ocx'),SW_HIDE);
end;
Fres := TResourceStream.Create(0,'SHOCKWAVEFILE',RT_RCDATA);
Ffile := TFileStream.Create('banneranuncio.swf',fmCreate);
Try
Ffile.CopyFrom(Fres,Fres.Size);
Fres.Free;
Finally
Ffile.Free;
end;
ShockwaveFlash1.Movie := AppDir+'/banneranuncio.swf';
end;

//-------------

请大家学习,谢谢
 
laohe, 真是个大好人[:D][:D][:D]
 
接受答案了.
 
顶部