thanks ulrich, but im afraid because totally i dont know how to do it with the code using window enumerat process or system terminate process..
whats in my mind is when i run the app i will put the PID in label, and there is one button to terminate the PID.
i found this ex in documentation: but i think is different to what i want.
instances_of_file = 0;
file_to_check_for = "autorun.exe"; --have all lowercase
processes = Window.EnumerateProcesses();
for j, file_path in pairs(processes) do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
instances_of_file = instances_of_file + 1;
end
end
if instances_of_file > 1 then
Window.Hide(Application.GetWndHandle());
Dialog.Message("Error", "Autorun already running: code: already running");
Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
else
Window.Show(Application.GetWndHandle());
end
Announcement
Collapse
No announcement yet.
Kill PID process
Collapse
X
-
The command works properly. If you are unable to make it work, please post your exported project (*.apz), so one can see what you are actually doing.
Ulrich
Leave a comment:
-
i am having trouble also with this command..
i am trying System.TerminateProcess but no luck on how to do it.. newbie here...
the same process as above.. how can i get the PID of my application? or other application?
Leave a comment:
-
Kill PID process
How to kill the exe that has a process ID
I have more running exe in the process want to kill only certain pidTags: None
Leave a comment: