PDA

View Full Version : close program like suf6



bert
03-15-2005, 09:33 AM
Hallo,

i want to close a running process called rslogon.exe

it worked in the background

i use the example from "Window.EnumerateProcesses"
but the running program could not be found.

i hope somebody can help

thanks bert


instances_of_file = 0;
file_to_check_for = "rslogon.exe"; --have all lowercase
processes = Window.EnumerateProcesses();

for j, file_path in 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 > 0 then
Window.Hide(Application.GetWndHandle());
Dialog.Message("Error", "Setup already running: code: already running");
Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
else
Window.Show(Application.GetWndHandle());
end

Adam
03-18-2005, 09:19 AM
Bert,

There are some cases where a process will not be detected by the Window.EnumerateProcess() action. I will log this for the developers to look into for a future version.

Adam Kapilik

JLGauntt
06-30-2005, 03:34 PM
Any progress being made on adding this ability back into the product?

I am converting our old SUF6 product installations into SUF7 and this is a really vital feature for us. (Vital like... I basically have to tell my product support department we can't use SUF7 until this feature is in the process or else I have to write a standalone kill application for our older systems since the "TASKKILL" command was not added until Windows 2003. And that's really not in my schedule at the moment).

--- janet

Adam
06-30-2005, 03:54 PM
This has not changed to date.

Adam Kapilik

Eagle
06-30-2005, 09:38 PM
FWIW I have found that setting to all 'levels' will open up detection
and usually will nail the proccess-s you are chasing to
hide, close or terminate.

processes = Window.EnumerateProcesses(false); --all

for standard proccesses.. the 'instances value' will usually be 3
(instead of 1, when only enumerating top level proccesses)
-- so watch out for this aspect