var
Ok: Bool;
ProcessHandle: Thandle;
ProcessListHandle: Thandle;
Processstruct: TProcessentry32; //user tlhelp32;
begin
ProcessListHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
Processstruct.dwSize := sizeof(Processstruct);
ok := process32first(ProcessListHandle, processstruct);
while Ok do
begin
if ansilowercase(Processstruct.szExeFile) = 'photoshop.exe' then
begin
ProcessHandle := OpenProcess(PROCESS_TERMINATE, False, Processstruct.th32ProcessID);
TerminateProcess(ProcessHandle, 0);
CloseHandle(ProcessHandle)
end;
ok := Process32Next(ProcessListHandle, Processstruct);
end;
closehandle(ProcessListHandle);