1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
procedure TfrmCmdPowerDVD.FormCreate(Sender: TObject);
var Result:integer;
StartInfo : TStartupInfo;
ProcessInfo : TProcessInformation;
begin
// Recherche de POWERDVD.EXE
PowerDVDHandle:=FindWindow('Class of CyberLink Universal Player','POWERDVD');
if (PowerDVDHandle=0) then
begin
lblHandle.Caption:='Not detected';
// On le lance
CreateProcess(Nil, '"C:\Program Files\CyberLink\PowerDVD\PowerDVD.exe"'
, Nil, Nil, False, 0, Nil, Nil, StartInfo, ProcessInfo);
//Result:=ShellExecute(0,'OPEN','C:\Program Files\CyberLink\PowerDVD\PowerDVD.exe',Nil,Nil,SW_SHOW); OK
//Sleep(3000);
if Result<31 then
begin
end
else
begin
PowerDVDHandle:=FindWindow('Class of CyberLink Universal Player','POWERDVD');
lblHandle.Caption:='Lancer ='+IntToStr(PowerDVDHandle);
end;
end
else
lblHandle.Caption:='Detected='+IntToStr(PowerDVDHandle);
end; |
Partager