kaan_karabey Posted November 20, 2014 Share Posted November 20, 2014 (edited) Arkadaşlar Ben Şu Kodla Çalışan Programı Kapatmak İstiyorum Yalnız İkisini Kapatmıyor Sadece 1 tanesini Kapatıyor. Kullandığım Kod: kapat = Dialog.Message("Dikkat !", "Programlar Açık İse Kapanacak Devam Etmek İstiyor Musunuz ?", MB_YESNO, MB_ICONINFORMATION, MB_DEFBUTTON1); if kapat == 6 then -- evet butonu seçilirse ; file_to_check_for = "1.exe" and "2.exe"; processes = System.EnumerateProcesses(); for j, file_path in pairs (processes) do file = String.SplitPath(file_path); if (file.Filename..file.Extension) == file_to_check_for then System.TerminateProcess(j); end end else os.exit(); end İkisini Kapatması İçin Nasıl Bir Durum İzlemem Gerek??? Birde Uygulamanın 1 Kere Açılmasını Nasıl Yapabilirim??? Edited November 20, 2014 by kaan_karabey Quote Link to comment Share on other sites More sharing options...
Cyph3r Posted November 20, 2014 Share Posted November 20, 2014 Kendim şöyle bir örnek hazırlayıp test ettim işe yaradı... kapatılmak istenen programları tablo yaptım sonra Processes tablosundakiler le karşılaştırıp kapattırdım... kapat = Dialog.Message("Dikkat !", "Programlar Açık İse Kapanacak Devam Etmek İstiyor Musunuz ?", MB_YESNO, MB_ICONINFORMATION, MB_DEFBUTTON1); if kapat == 6 then -- evet butonu seçilirse ; Processes = System.EnumerateProcesses(); file_to_check_for = {"notepad.exe" , "WinRAR.exe" , "firefox.exe" } for j, file_path in pairs (Processes) do file = String.SplitPath(file_path); for i in pairs (file_to_check_for) do if (file.Filename..file.Extension) == file_to_check_for[i] then System.TerminateProcess(j); end end end else os.exit(); end Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.