Subversion Repositories Kolibri OS

Rev

Rev 5548 | Rev 5622 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef INCLUDE_RESTART_PROCESS_H
  2. #define INCLUDE_RESTART_PROCESS_H
  3.  
  4. #ifndef INCLUDE_KOLIBRI_H
  5. #include "../lib/kolibri.h"
  6. #endif
  7.  
  8. enum {
  9.         MULTIPLE,
  10.         SINGLE
  11. };
  12.  
  13. void RestartProcessByName(dword proc_name, byte multiple) {
  14.         int i;
  15.         proc_info Process;
  16.         for (i=0; i<1000; i++;)
  17.         {
  18.                 GetProcessInfo(#Process, i);
  19.                 if (strcmpi(#Process.name, proc_name)==0)
  20.                 {
  21.                         KillProcess(Process.ID);
  22.                         if (multiple==SINGLE) break;
  23.                 }
  24.         }
  25.         RunProgram(proc_name, "");     
  26. }
  27.  
  28. #endif