PDA

View Full Version : Detect AVI Playing or Finished



NewsArchive
09-27-2001, 12:00 AM
Guys,

does anyone have a function which can detect if a .avi video has finished
playing? I tried using Is(FileLocked) but that did not work.

We want to make sure the whole video plays once Asynchronously.

--
Andrew Sims
Programmer
Synigence plc

NewsArchive
09-28-2001, 12:00 AM
Hello,

Here's a function that I wrote, to use for detecting if the previous setup
has thrown a MessageBox or not.

I think you can use it to detect if the mplayer2.exe ( MediaPlayer ) Window
is still active or not.

Or you can check the mplayer2.exe itself to detect if it's still working (
in use ) or not.

Here's the function that checks if there's a messagebox within the given
number of seconds ( with the defined caption ) or not ...
P.S. Sorry for any inconvinience with the inline Turkish comments. Hope it
can help.

Aklen ALTINEL



prototype hinstall_Installed(string , string , number , number );
function hinstall_Installed(szHASPPath, szCMDFlags, nWAIT, nSeconds)

STRING szMsg,sTxtFile,sFolderll,sFolder,sHASP,SETUPINFTXT, szWAIT;
NUMBER nvFileHandle,nOfHASPInstallation,nTotalSeconds;
HWND hWnd;

begin
sTxtFile="setupinf.txt";
sFolderll="\\netokur\\";
sFolder="\\netokur";


//hinstall.exe Command line flag -cm :display critical message(cm) only
//Normalde hinstall.exe -i ile cagiririz fakat HASP kurulumunun basarili
olup olmadigini
//gosteren diyalog kutusunda yazan statik texti alip setup log dosyasina
yazamadigimiz icin
//biz de hinstall.exe -cm ile cagiriyoruz. sadece problem cikarsa HASP
dialog kutusu cikiyor.
//Asagidaki kod bir HASP Diyalog kutusu yakalarsa problem cikmis kabul
ediyoruz.

switch (SELECTED_LANGUAGE)
case ISLANG_TURKISH:
szMsg ="Güvenlik programý kuruluyor... Lütfen Bekleyiniz.";
case ISLANG_ENGLISH:
szMsg ="Installing security software... Please wait... This may take a
few minutes.";
endswitch;

SdShowMsg(szMsg,TRUE);
nOfHASPInstallation = 0;
for nTotalSeconds = 0 to nSeconds
if ( nOfHASPInstallation = 0 ) then
if (LaunchAppAndWait(szHASPPath,szCMDFlags,nWAIT) < 0 ) then
switch (SELECTED_LANGUAGE)
case ISLANG_TURKISH:
MessageBox("HATA\nGüvenlik programý kurulumu çalýþtýrýlamadý.\nKurulum
klasöründe bulunan hinstall.exe güvenlik programý dosyasý
çalýþtýrýlamadý\n",SEVERE);
case ISLANG_ENGLISH:
MessageBox("Error\nProduct security software setup could not be
run\nhinstall.exe file in setup folder\n",SEVERE);
endswitch;
endif;

else
Delay(1);
hWnd=(FindWindow("#32770","Aladdin Device Driver Installation Utility
for Win32"));
if (hWnd= NULL) then
sHASP="HASP_SILENT_INSTALLED";
else
sHASP="HASP_CRITICAL_MESSAGE";
nSeconds = nSeconds+1;
switch (SELECTED_LANGUAGE)
case ISLANG_TURKISH:
MessageBox("UYARI\nGüvenlik Programý kurulumu hata mesajý
yakalandý.\nSisteminizi yeniden baþlatmanýz ve kurulumu tekrarlamanýz
önerilir.\n",SEVERE);
case ISLANG_ENGLISH:
MessageBox("WARNING\nA possible error window of product security software
setup is found.\nIt's recommended that you uninstall the sotware, restart
your system and launch setup again.\n",SEVERE);
endswitch;
endif;

endif;
nOfHASPInstallation = 1 ;
endfor;

SdShowMsg(szMsg,FALSE);


SETUPINFTXT=TARGETDIR+sFolderll+sTxtFile;
if (Is(FILE_EXISTS,SETUPINFTXT)=1)then
OpenFileMode(FILE_MODE_APPEND);//Dosyayi bulursak append etmeye
calisiyoruz.
if(OpenFile(nvFileHandle,TARGETDIR+sFolderll,sTxtFile)<0)then
MessageBox("Can not open setupinf file for final report",INFORMATION);
else
//DEBUG_BOX//WriteLine(nvFileHandle,"On_Setup_Exit_HASP "+sHASP);
WriteLine(nvFileHandle,"GVZ_Setup_Exit_SUCCESS");
WriteLine(nvFileHandle,"HASP_Setup_Exit "+sHASP);
CloseFile (nvFileHandle);
endif;
else //Bulamazsak kendimiz dosyayi aciyoruz.
OpenFileMode(FILE_MODE_APPEND);
if(OpenFile(nvFileHandle,TARGETDIR+sFolderll,sTxtFile)<0)then
MessageBox("Can not create setupinf file for final report",INFORMATION);
else
//DEBUG_BOX//WriteLine(nvFileHandle,"On_Setup_Exit_HASP "+sHASP);
WriteLine(nvFileHandle,"GVZ_Setup_Exit_SUCCESS");
WriteLine(nvFileHandle,"HASP_Setup_Exit "+sHASP);
CloseFile (nvFileHandle);
endif;

endif;
end;


--
Aklen ALTINEL

aklen@email.com
aklenaklen@hotmail.com
"Andrew Sims" <asims@synigence.net> wrote in message
news:3bb33b26$1@news.installshield.com...
> Guys,
>
> does anyone have a function which can detect if a .avi video has finished
> playing? I tried using Is(FileLocked) but that did not work.
>
> We want to make sure the whole video plays once Asynchronously.
>
> --
> Andrew Sims
> Programmer
> Synigence plc
>
>

NewsArchive
09-28-2001, 12:00 AM
thanks very useful.

--
Andrew Sims
Programmer
Synigence plc
Aklen ALTINEL <aklen@email.com> wrote in message
news:3bb3a1a6@news.installshield.com...
> Hello,
>
> Here's a function that I wrote, to use for detecting if the previous setup
> has thrown a MessageBox or not.
>
> I think you can use it to detect if the mplayer2.exe ( MediaPlayer )
Window
> is still active or not.
>
> Or you can check the mplayer2.exe itself to detect if it's still working (
> in use ) or not.
>
> Here's the function that checks if there's a messagebox within the given
> number of seconds ( with the defined caption ) or not ...
> P.S. Sorry for any inconvinience with the inline Turkish comments. Hope it
> can help.
>
> Aklen ALTINEL
>
>
>
> prototype hinstall_Installed(string , string , number , number );
> function hinstall_Installed(szHASPPath, szCMDFlags, nWAIT, nSeconds)
>
> STRING szMsg,sTxtFile,sFolderll,sFolder,sHASP,SETUPINFTXT, szWAIT;
> NUMBER nvFileHandle,nOfHASPInstallation,nTotalSeconds;
> HWND hWnd;
>
> begin
> sTxtFile="setupinf.txt";
> sFolderll="\\netokur\\";
> sFolder="\\netokur";
>
>
> file://hinstall.exe Command line flag -cm :display critical message(cm)
only
> file://Normalde hinstall.exe -i ile cagiririz fakat HASP kurulumunun
basarili
> olup olmadigini
> file://gosteren diyalog kutusunda yazan statik texti alip setup log
dosyasina
> yazamadigimiz icin
> file://biz de hinstall.exe -cm ile cagiriyoruz. sadece problem cikarsa
HASP
> dialog kutusu cikiyor.
> file://Asagidaki kod bir HASP Diyalog kutusu yakalarsa problem cikmis
kabul
> ediyoruz.
>
> switch (SELECTED_LANGUAGE)
> case ISLANG_TURKISH:
> szMsg ="Güvenlik programý kuruluyor... Lütfen Bekleyiniz.";
> case ISLANG_ENGLISH:
> szMsg ="Installing security software... Please wait... This may take a
> few minutes.";
> endswitch;
>
> SdShowMsg(szMsg,TRUE);
> nOfHASPInstallation = 0;
> for nTotalSeconds = 0 to nSeconds
> if ( nOfHASPInstallation = 0 ) then
> if (LaunchAppAndWait(szHASPPath,szCMDFlags,nWAIT) < 0 ) then
> switch (SELECTED_LANGUAGE)
> case ISLANG_TURKISH:
> MessageBox("HATA\nGüvenlik programý kurulumu çalýþtýrýlamadý.\nKurulum
> klasöründe bulunan hinstall.exe güvenlik programý dosyasý
> çalýþtýrýlamadý\n",SEVERE);
> case ISLANG_ENGLISH:
> MessageBox("Error\nProduct security software setup could not be
> run\nhinstall.exe file in setup folder\n",SEVERE);
> endswitch;
> endif;
>
> else
> Delay(1);
> hWnd=(FindWindow("#32770","Aladdin Device Driver Installation Utility
> for Win32"));
> if (hWnd= NULL) then
> sHASP="HASP_SILENT_INSTALLED";
> else
> sHASP="HASP_CRITICAL_MESSAGE";
> nSeconds = nSeconds+1;
> switch (SELECTED_LANGUAGE)
> case ISLANG_TURKISH:
> MessageBox("UYARI\nGüvenlik Programý kurulumu hata mesajý
> yakalandý.\nSisteminizi yeniden baþlatmanýz ve kurulumu tekrarlamanýz
> önerilir.\n",SEVERE);
> case ISLANG_ENGLISH:
> MessageBox("WARNING\nA possible error window of product security
software
> setup is found.\nIt's recommended that you uninstall the sotware, restart
> your system and launch setup again.\n",SEVERE);
> endswitch;
> endif;
>
> endif;
> nOfHASPInstallation = 1 ;
> endfor;
>
> SdShowMsg(szMsg,FALSE);
>
>
> SETUPINFTXT=TARGETDIR+sFolderll+sTxtFile;
> if (Is(FILE_EXISTS,SETUPINFTXT)=1)then
> OpenFileMode(FILE_MODE_APPEND);//Dosyayi bulursak append etmeye
> calisiyoruz.
> if(OpenFile(nvFileHandle,TARGETDIR+sFolderll,sTxtFile)<0)then
> MessageBox("Can not open setupinf file for final report",INFORMATION);
> else
> file://DEBUG_BOX//WriteLine(nvFileHandle,"On_Setup_Exit_HASP "+sHASP);
> WriteLine(nvFileHandle,"GVZ_Setup_Exit_SUCCESS");
> WriteLine(nvFileHandle,"HASP_Setup_Exit "+sHASP);
> CloseFile (nvFileHandle);
> endif;
> else file://Bulamazsak kendimiz dosyayi aciyoruz.
> OpenFileMode(FILE_MODE_APPEND);
> if(OpenFile(nvFileHandle,TARGETDIR+sFolderll,sTxtFile)<0)then
> MessageBox("Can not create setupinf file for final
report",INFORMATION);
> else
> file://DEBUG_BOX//WriteLine(nvFileHandle,"On_Setup_Exit_HASP "+sHASP);
> WriteLine(nvFileHandle,"GVZ_Setup_Exit_SUCCESS");
> WriteLine(nvFileHandle,"HASP_Setup_Exit "+sHASP);
> CloseFile (nvFileHandle);
> endif;
>
> endif;
> end;
>
>
> --
> Aklen ALTINEL
>
> aklen@email.com
> aklenaklen@hotmail.com
> "Andrew Sims" <asims@synigence.net> wrote in message
> news:3bb33b26$1@news.installshield.com...
> > Guys,
> >
> > does anyone have a function which can detect if a .avi video has
finished
> > playing? I tried using Is(FileLocked) but that did not work.
> >
> > We want to make sure the whole video plays once Asynchronously.
> >
> > --
> > Andrew Sims
> > Programmer
> > Synigence plc
> >
> >
>
>