kolibrios-gitea/programs/cmm/lib/patterns/restart_process.h
Kirill Lipatov (Leency) e0615bc762 Rtfread:
- remove outdated unused code
- use built-in font instead of a file in /fonts/ folder

git-svn-id: svn://kolibrios.org@7433 a494cfbc-eb01-0410-851d-a64ba20cac60
2018-10-04 17:53:33 +00:00

46 lines
872 B
C

#ifndef INCLUDE_RESTART_PROCESS_H
#define INCLUDE_RESTART_PROCESS_H
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
#endif
enum {
MULTIPLE,
SINGLE
};
#define MAX_PROCESS_COUNT 256
:bool CheckProcessExists(dword proc_name) {
int i;
proc_info Process;
for (i=0; i<MAX_PROCESS_COUNT; i++;)
{
GetProcessInfo(#Process, i);
if (strcmpi(#Process.name, proc_name)==0) return 1;
}
return 0;
}
:void KillProcessByName(dword proc_name, byte multiple) {
int i;
proc_info Process;
for (i=0; i<MAX_PROCESS_COUNT; i++;)
{
GetProcessInfo(#Process, i);
if (strcmpi(#Process.name, proc_name)==0)
{
KillProcess(Process.ID);
if (multiple==SINGLE) break;
}
}
}
:void RestartProcessByName(dword proc_name, byte multiple) {
KillProcessByName(proc_name, multiple);
RunProgram(proc_name, "");
}
#endif