guclusat

Tanınmış Üye
Süper Moderatör
Run a Program and Wait for it to Finish

Using AutoPlay Media Studio, you can launch an executable file, and have your application wait until that
executable file exits.

As an example we will run the executable example.exe, and have the application wait until example.exe is
closed. This is accomplished by using the File.Run action, and setting the WaitForReturn property to true:
Kod:
File.Run("c:\\example.exe", "", "", SW_SHOWNORMAL, true);
Note: This action will launch example.exe, and wait until example.exe is terminated.
 
Bir Programı Çalıştır ve Bitmesini Bekle" konusu, özellikle kurulum sihirbazları veya ardışık işlem gerektiren projeler için çok değerli bir bilgi.
AutoPlay Media Studio'da (AMS) bir dış dosyayı çalıştırıp, o dosya kapanana kadar ana uygulamanın beklemesini sağlamak için File.Run komutundaki "WaitForReturn" parametresini kullanıyoruz.

Kullanılan Kod Örneği:​

Kod:
-- c:\örnek.exe dosyasını çalıştırır ve o kapanana kadar bekler
File.Run("c:\\örnek.exe", "", "", SW_SHOWNORMAL, true);

Kodun Mantığı:​

  • "c:\\örnek.exe": Çalıştırılacak dosyanın yolu.
  • SW_SHOWNORMAL: Programın normal pencere boyutunda açılmasını sağlar.
  • true: İşte kilit nokta burası. Bu parametre true olduğunda, AMS çalıştırdığı program kapanmadan bir sonraki satıra geçmez. Eğer false yaparsan, programı açar ve hemen kendi işine devam eder.
 
Geri
Yukarı