كيف أجل البرنامج يغلق بع إتهاء مهمته
#2
وعليكم السلام ورحمة الله وبركاته ومغفرته

هل تقصد هذا ؟
PHP كود :
Execute a program and wait until it has finished. The following example uses the ShellExecuteEx API function.

 
// Execute the Windows Calculator and pop up
 // a message when the Calc is terminated.
 
uses ShellApi;
 ...
 var
    
SEInfo: TShellExecuteInfo;
    
ExitCode: DWORD;
    
ExecuteFile, ParamString, StartInString: string;
 
begin
    ExecuteFile
:='c:\Windows\Calc.exe';
 
    
FillChar(SEInfo, SizeOf(SEInfo), 0) ;
    
SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
    
with SEInfo do begin
      fMask 
:= SEE_MASK_NOCLOSEPROCESS;
      
Wnd := Application.Handle;
      
lpFile := PChar(ExecuteFile) ;
 {
 
ParamString can contain the
 application parameters
.
 }
 
// lpParameters := PChar(ParamString) ;
 
{
 
StartInString specifies the
 name of the working directory
.
 If 
ommited, the current directory is used.
 }
 
// lpDirectory := PChar(StartInString) ;
      
nShow := SW_SHOWNORMAL;
    
end;
    if 
ShellExecuteEx(@SEInfo) then begin
      repeat
        Application
.ProcessMessages;
        
GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
      
until (ExitCode <> STILL_ACTIVE) or
      
Application.Terminated;
      
ShowMessage('Calculator terminated') ;
    
end
    
else ShowMessage('Error starting Calc!') ;
 
end; 
لأستهلنّ الصعب أو أدرك المنى    فما انقادت الآمال إلاّ لصابر
الرد


الردود في هذا الموضوع
كيف أجل البرنامج يغلق بع إتهاء مهمته - بواسطة mobile - 01-08-2014, 03:12 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم