2005年07月31日

事前に登録したプログラムを順番に終了させる方法

空の雲は厚く、郊外は緑のジャングル、
時おりスコールと雷鳴が都会慣れした我々を脅かす。
日本の梅雨と変わらない気候が重くのしかかる。
そこは赤道にほど近い東南アジアのとある場所...

先進国で生活されるほとんどの皆さんは、
水道、ガス、電気などのライフラインは
整備されいることが当たり前と思われるでしょう。
私が出張で滞在した東南アジアのライフラインは、
日本の水準では考えられないものでした。

雷が鳴るたびに電源の供給が停止し、
機関系システムが、
たびたびUPS電源のお世話になるのです。
停電も日本のように瞬停ではなく、
復旧しないこともしばしばありました。
(今では改善され良くなったと聞きますが...)

少し前置きが長くなりました。
今回は停電発生時にUPSの
自動シャットダウン機能などから実行し、
機関系システムの関連プロセスを一斉に終了させるのに便利な
WindowsのサンプルプログラムをDelphiで紹介しましょう。
OSシャットダウン前に、関連プロセスを順番に終了し、
大切なデータを保護することが目的です。

通常の行儀良いWindowsアプリケーションは、
「WM_QUIT」メッセージを受信すると終了処理を行います。
中にはははみ出し者がいるもので、
これに従わなアプリケーションもあることでしょう。

本プログラムはINIファイルに記述されたプログラム名を、
EnumWindows」、「EnumProcesses」APIの
実行結果から情報を検索し終了させます。
終了手順は、該当プロセスへ「WM_QUIT」を送信し、
相手が自主的に行儀良く終了するのを待ちます。
一定時間内に相手が終了しない場合、
TerminateProcess」を発行し強制的に終了させます。
一連の処理を実行後、本プログラムは自動で終了し、
起動から終了までの処理をログファイルに書き込みます。

処理内容
説明
@プロセスの取得
「EnumWindows」、「EnumProcesses」などのAPIを利用し、現在稼動中のプロセス情報を取得する。基本的にウィンドウを持つプロセスの情報を取得する。
AINIファイルの読込
INIファイルを読込み、終了させたいプロセスの実行モジュール名を取得する。
Bプロセスの終了
Aで読込んだ実行モジュール名を@のプロセス情報から取得し終了処理を行う。はじめ該当プロセスへ「WM_QUIT」を送信するが、一定時間以上応答が無い場合、「TerminateProcess」APIを発行し該当プロセスを強制終了する。

全ソースは【続きを読む】をクリック!

【画面イメージ】

Terminator.gif

関連書籍


Copyright guy@かしらもんじ でぇ〜

注意:
 下記ソースファイルは、本ページの管理者である「guy」が個人的に作成しました。
 このソースは作者に断り無く、個人がコピー、改造することは許可しますが、
 いかなる場合であっても、商用目的に使用することを固く禁じます。
 あと、ホームページでの公開の都合上、各ソースの先頭に全角スペースが入ってます。
 あなたがDelphiでコンパイルする前に、この全角スペースを半角スペースに変換してくださいね。

Delphi Project File: Terminator.dpr
program Terminator;

uses
 Forms,
 TerminatorGUIUnit in 'TerminatorGUIUnit.pas' {frmTerminator};

{$R *.RES}

begin
 Application.Initialize;
 Application.Title := 'Terminator';
 Application.CreateForm(TfrmTerminator, frmTerminator);
 Application.Run;
end.


Delphi Form File: TerminatorGUIUnit.dfm
object frmTerminator: TfrmTerminator
 Left = 192
 Top = 107
 Width = 460
 Height = 300
 Caption = 'Terminator'
 Color = clBtnFace
 Font.Charset = ANSI_CHARSET
 Font.Color = clWindowText
 Font.Height = -12
 Font.Name = 'Terminal'
 Font.Style = []
 Icon.Data = {
  0000010002002020100000000000E80200002600000010101000000000002801
  00000E0300002800000020000000400000000100040000000000800200000000
  0000000000000000000000000000000000000000800000800000008080008000
  0000800080008080000080808000C0C0C0000000FF0000FF000000FFFF00FF00
  0000FF00FF00FFFF0000FFFFFF00000000000000000000000000000000000000
  0000000000000000000000000000000000000000000000000000000000000000
  00000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000FF
  0F0F0F0F0F0F0F0F0F0FF0F0FF00000FF0F0F0F0F0F0F0F0F0FF0F0FF0000000
  FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000
  0000077777777777777700000000000000000000000000000000000000000000
  00000FFFFFFFFFFFFFFF00000000000000000FFFFFFFFFFFFFFF000000000000
  00000FFFFFFFFFFFFFFF00000000000000000FFFFFF0000000FF000000000000
  00000FFFFFFFFFFFFFFF00000000000000000FFFFFFFFFFFFFFF000000000000
  00000FF00000000000FF00000000000000000F0777777777770F000000000000
  00000F0888888888870F00000000000000000F0888888888870F000000000000
  00000F0888888888870F00000000000000000F0888888888870F000000000000
  00000F0888888888870F00000000000000000F0888888888870F000000000000
  00000F0888888888870F00000000000000000FF00000000000FF000000000000
  00000FFFFFFFFFFFFFFF00000000000000000000000000000000000000000000
  0000000000000000000000000000000000000000000000000000000000000000
  0000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000
  000080000001C0000003E0000007F000000FFF00007FFF00007FFF00007FFF00
  007FFF00007FFF00007FFF00007FFF00007FFF00007FFF00007FFF00007FFF00
  007FFF00007FFF00007FFF00007FFF00007FFF00007FFF00007FFF00007FFF80
  00FFFFFFFFFFFFFFFFFFFFFFFFFF280000001000000020000000010004000000
  0000C00000000000000000000000000000000000000000000000000080000080
  00000080800080000000800080008080000080808000C0C0C0000000FF0000FF
  000000FFFF00FF000000FF00FF00FFFF0000FFFFFF0000000000000000000000
  0000000000000F0F0F0F0F0F0F0000F0F0F0F0F0F00000000000000000000000
  07777777000000000FFFFFFF000000000FFF777F000000000FFFFFFF00000000
  0F77777F000000000F78887F000000000F78887F000000000F77777F00000000
  0FFFFFFF000000000000000000000000000000000000FFFF0000000000000000
  000080010000C0030000F0070000F0070000F0070000F0070000F0070000F007
  0000F0070000F0070000F0070000F80F0000FFFF0000}
 OldCreateOrder = False
 Position = poScreenCenter
 OnCreate = FormCreate
 OnDestroy = FormDestroy
 PixelsPerInch = 96
 TextHeight = 15
 object memLog: TMemo
  Left = 0
  Top = 0
  Width = 452
  Height = 266
  Align = alClient
  Color = clGray
  Font.Charset = ANSI_CHARSET
  Font.Color = clWhite
  Font.Height = -11
  Font.Name = 'Terminal'
  Font.Style = []
  ParentFont = False
  ScrollBars = ssBoth
  TabOrder = 0
 end
 object edtName: TEdit
  Left = 40
  Top = 6
  Width = 60
  Height = 22
  TabStop = False
  Font.Charset = ANSI_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Terminal'
  Font.Style = []
  ParentFont = False
  TabOrder = 1
  Visible = False
 end
 object btnQuit: TButton
  Left = 40
  Top = 30
  Width = 60
  Height = 20
  Caption = 'Quit'
  Font.Charset = ANSI_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Terminal'
  Font.Style = []
  ParentFont = False
  TabOrder = 2
  TabStop = False
  Visible = False
  OnClick = btnQuitClick
 end
 object btnExec: TButton
  Left = 100
  Top = 30
  Width = 60
  Height = 20
  Caption = 'Exec'
  Font.Charset = ANSI_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Terminal'
  Font.Style = []
  ParentFont = False
  TabOrder = 3
  TabStop = False
  Visible = False
  OnClick = btnExecClick
 end
 object btnExit: TButton
  Left = 160
  Top = 30
  Width = 60
  Height = 20
  Caption = 'Exit'
  Font.Charset = ANSI_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Terminal'
  Font.Style = []
  ParentFont = False
  TabOrder = 4
  TabStop = False
  Visible = False
  OnClick = btnExitClick
 end
 object Timer: TTimer
  Enabled = False
  Left = 6
  Top = 6
 end
end


Delphi Source File: TerminatorGUIUnit.pas
unit TerminatorGUIUnit;

interface

uses
 Classes,
 Controls,
 Dialogs,
 ExtCtrls,
 Forms,
 Graphics,
 Messages,
 Psapi,
 StdCtrls,
 SysUtils,
 Windows;

const
 FILENAME_INI = 'Terminator.ini';
 FILENAME_LOG = 'Terminator.log';

type
 //----------------------------------------------------------------------------
 TfrmTerminator = class(TForm)
  Timer: TTimer;
  memLog: TMemo;
  edtName: TEdit;
  btnQuit: TButton;
  btnExec: TButton;
  btnExit: TButton;
  procedure FormCreate(Sender: TObject);
  procedure FormDestroy(Sender: TObject);
  procedure btnQuitClick(Sender: TObject);
  procedure btnExecClick(Sender: TObject);
  procedure btnExitClick(Sender: TObject);
 private
  FLogFile: TextFile;
  FExeList,
  FPIDList,
  FWndList: TStringList;

  procedure LogMessage(pMsg: String);
  procedure EnumProcessesProc(pPIDList, pWndList: TStrings);
  procedure Terminate(pName: String);
  procedure LoadParameter(pFileName: String);
  procedure LoadProcesses;
  procedure Execute;
 public
 end;

 //----------------------------------------------------------------------------
 function GetToken(var pSource: String; pDelimiter: String): String;
function EnumWindowsProc(pHwnd: HWND; pParam: Longint): Boolean; stdcall;

var
 frmTerminator: TfrmTerminator;

implementation

{$R *.DFM}

//------------------------------------------------------------------------------
function GetToken(var pSource: String; pDelimiter: String): String;
 //----------------------------------------------------------------------------
 function IsDelimiter(pSource, pDelimiter: String): Boolean;
 var
  lCnt: Integer;
 begin
  Result := False;
  for lCnt := 0 to Length(pDelimiter) do
  begin
   if (pSource = Copy(pDelimiter, lCnt, 1)) then
   begin
    Result := True;
    Break;
   end;
  end;
 end;
var
 lCnt,
 lPos: Integer;
 lStr,
 lChr: String;
 lFlg: Boolean;
begin
 lStr := pSource + Copy(pDelimiter, 1, 1);
 lFlg := False;
 for lCnt := 1 to Length(lStr) do
 begin
  lChr := Copy(lStr, lCnt, 1);
  if (IsDelimiter(lChr, pDelimiter)) then
  begin
   if (lFlg) then
   begin
    Result := Copy(lStr, lPos, lCnt-lPos);
    pSource := Copy(pSource, lCnt+1, Length(pSource));
    Exit;
   end;
  end
  else
  begin
   if (not lFlg) then
   begin
    lPos := lCnt;
    lFlg := True;
   end;
  end;
 end;
end;

//------------------------------------------------------------------------------
function EnumWindowsProc(pHwnd: HWND; pParam: Longint): Boolean; stdcall;
var
 lPID: DWORD;
begin
if (GetWindow(pHwnd, GW_OWNER) = 0) then
 begin
  GetWindowThreadProcessId(pHwnd, @lPID);
  if (pParam <> 0) then
   TStrings(pParam).Add(Format('%d,%d', [lPID, pHwnd]));
 end;
 Result := True;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.LogMessage(pMsg: String);
var
 lMsg: String;
begin
 lMsg := Format('%s %s', [FormatDateTime('yyyy/mm/dd-hh:nn:ss', Now), pMsg]);
 memLog.Lines.Add(lMsg);
 try
  Writeln(FLogFile, lMsg);
  Flush(FLogFile);
 except
 end;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.EnumProcessesProc(pPIDList, pWndList: TStrings);
 //----------------------------------------------------------------------------
 function GetWndHandle(pPID: Integer): Longint;
 var
  lCnt: Integer;
  lTmp: String;
 begin
  Result := 0;
  for lCnt := 0 to pWndList.Count-1 do
  begin
   lTmp := pWndList[lCnt];
   if (pPID = StrToIntDef(GetToken(lTmp, ','), 0)) then
   begin
    Result := StrToIntDef(GetToken(lTmp, ','), 0);
    Break;
   end;
  end;
 end;
var
 lCnt:   Integer;
 lProcess: array[0..1023] of DWORD;
 lPSize:  DWORD;
 lModule: array[0..1023] of HMODULE;
 lMSize:  DWORD;
 lExeName: array[0..1023] of Char;
 lHandle: DWORD;
begin
 LogMessage('----> EnumProcesses');
 ZeroMemory(@lProcess, Sizeof(lProcess));
 if (not EnumProcesses(@lProcess, Sizeof(lProcess), lPSize)) then Exit;
 for lCnt := 0 to (lPSize div Sizeof(DWORD))-1 do
 begin
  lHandle := OpenProcess(
   PROCESS_QUERY_INFORMATION+PROCESS_VM_READ, False, lProcess[lCnt]);
  if (lHandle <> 0) then
  begin
   ZeroMemory(@lModule, Sizeof(lModule));
   EnumProcessModules(lHandle, @lModule, Sizeof(lModule), lMSize);
   if (lMSize > 0) then
   begin
    ZeroMemory(@lExeName, Sizeof(lExeName));
    GetModuleBaseName(lHandle, lModule[0], @lExeName, Sizeof(lExeName));
    pPIDList.Add(
     Format('%s,%d,%d',
      [lExeName, lProcess[lCnt], GetWndHandle(lProcess[lCnt])]));
    LogMessage(
     Format('Append Process (AppName=%s,PID=%d,WndHandle=0x%x)',
      [lExeName, lProcess[lCnt], GetWndHandle(lProcess[lCnt])]));
   end;
   CloseHandle(lHandle);
  end;
 end;
 LogMessage('<---- EnumProcesses');
end;

//----------------------------------------------------------------------------
procedure TfrmTerminator.Terminate(pName: String);
var
 lCnt,
 lRet: Integer;
 lTmp: String;
 lPID,
 lHd1,
 lHd2: DWORD;
begin
 LogMessage('----> Terminate');
 LogMessage(Format('Find Process (AppName=%s) ...', [pName]));
 for lCnt := 0 to FPIDList.Count-1 do
 begin
  lTmp := FPIDList[lCnt];
  if (UpperCase(pName) = UpperCase(GetToken(lTmp, ','))) then
  begin
   lPID := STrToIntDef(GetToken(lTmp, ','), 0);
   lHd1 := STrToIntDef(GetToken(lTmp, ','), 0);
   // 選択されたウィンドウハンドルへ"WM_QUIT"のメッセージをポストする。
   // しばらく待って行儀良く終了しないプログラムを強制終了する。
   PostMessage(lHd1, WM_QUIT, 0, 0);
   LogMessage(
    Format('Post Quit Message to Process (PID=%d,WndHandle=0x%x)',
     [lPID, lHd1]));
   sleep(200);
   lHd2 := OpenProcess(
    SYNCHRONIZE + PROCESS_TERMINATE, False, lPID);
   if (GetLastError = 0) then
   begin
    TerminateProcess(lHd2, 0);
    CloseHandle(lHd2);
    LogMessage(
     Format('Terminate Process (PID=%d,Handle=0x%x)',
      [lPID, lHd2]));
   end;
  end;
 end;
 LogMessage('<---- Terminate');
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.LoadParameter(pFileName: String);
var
 lFile: TextFile;
 lLine,
 lName: String;
begin
 LogMessage('----> LoadParameter');
 FExeList.Clear;
 if not FileExists(pFileName) then
 begin
  LogMessage(Format('Not Found File (FileName=%s)', [pFileName]));
  Exit;
 end;
 try
  AssignFile(lFile, pFileName);
  Reset(lFile);
  while (not Eof(lFile)) do
  begin
   Readln(lFile, lLine);
   while (lLine <> '') do
   begin
    lName := GetToken(lLine, ',');
    FExeList.Add(lName);
    LogMessage(Format('Append Parameter (AppName=%s)', [lName]));
   end;
  end;
  CloseFile(lFile);
 except
 end;
 LogMessage('<---- LoadParameter');
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.LoadProcesses;
begin
 FPIDList.Clear;
 FWndList.Clear;
 EnumWindows(@EnumWindowsProc, Longint(FWndList));
 EnumProcessesProc(FPIDList, FWndList);
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.Execute;
var
 lCnt: Integer;
begin
 LoadProcesses;
 LoadParameter(ExtractFilePath(Application.ExeName)+FILENAME_INI);
 for lCnt := 0 to FExeList.Count-1 do
  Terminate(FExeList.Strings[lCnt]);
 Timer.Interval := 3000;
 Timer.OnTimer := Self.btnExitClick;
 Timer.Enabled := True;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.FormCreate(Sender: TObject);
begin
 AssignFile(FLogFile, ExtractFilePath(Application.ExeName)+FILENAME_LOG);
 Rewrite(FLogFile);
 LogMessage('Terminator Start!');
 FExeList := TStringList.Create;
 FPIDList := TStringList.Create;
 FWndList := TStringList.Create;
 Timer.Interval := 2000;
 Timer.OnTimer := Self.btnExecClick;
 Timer.Enabled := True;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.FormDestroy(Sender: TObject);
begin
 LogMessage('Terminator Finish!');
 CloseFile(FLogFile);
 if (FExeList <> Nil) then
 begin
  FExeList.Free;
  FExeList := Nil;
 end;
 if (FPIDList <> Nil) then
 begin
  FPIDList.Free;
  FPIDList := Nil;
 end;
 if (FWndList <> Nil) then
 begin
  FWndList.Free;
  FWndList := Nil;
 end;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.btnQuitClick(Sender: TObject);
begin
 Terminate(edtName.Text);
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.btnExecClick(Sender: TObject);
begin
 Timer.Enabled := False;
 Execute;
end;

//------------------------------------------------------------------------------
procedure TfrmTerminator.btnExitClick(Sender: TObject);
begin
 Timer.Enabled := False;
 Self.Close;
end;

end.


Sample File: Terminator.ini
Loop1.exe
Loop2.exe


Sample File: Terminator.log
2005/06/17-05:10:05 Terminator Start!
2005/06/17-05:10:07 ----> EnumProcesses
2005/06/17-05:10:08 Append Process (AppName=?,PID=8,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=smss.exe,PID=152,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=winlogon.exe,PID=200,WndHandle=0x10016)
2005/06/17-05:10:08 Append Process (AppName=services.exe,PID=228,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=lsass.exe,PID=240,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=ibmpmsvc.exe,PID=360,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=svchost.exe,PID=424,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=svchost.exe,PID=472,WndHandle=0x40044)
2005/06/17-05:10:08 Append Process (AppName=spoolsv.exe,PID=524,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=DKService.exe,PID=576,WndHandle=0x10022)
2005/06/17-05:10:08 Append Process (AppName=dbsnmp.exe,PID=620,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=vppdc.exe,PID=656,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=MSTask.exe,PID=772,WndHandle=0x20026)
2005/06/17-05:10:08 Append Process (AppName=Tmntsrv.exe,PID=820,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=tmproxy.exe,PID=864,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=WinMgmt.exe,PID=972,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=Explorer.EXE,PID=1092,WndHandle=0x1070C)
2005/06/17-05:10:08 Append Process (AppName=PccPfw.exe,PID=1144,WndHandle=0x20034)
2005/06/17-05:10:08 Append Process (AppName=imejpmgr.exe,PID=1296,WndHandle=0x1007C)
2005/06/17-05:10:08 Append Process (AppName=tp4serv.exe,PID=1340,WndHandle=0x100E4)
2005/06/17-05:10:08 Append Process (AppName=Promon.exe,PID=1368,WndHandle=0x100AA)
2005/06/17-05:10:08 Append Process (AppName=TPHKMGR.exe,PID=1376,WndHandle=0x100E0)
2005/06/17-05:10:08 Append Process (AppName=ezSP_PxEngine.exe,PID=1396,WndHandle=0x1013A)
2005/06/17-05:10:08 Append Process (AppName=ltcm000c.exe,PID=1416,WndHandle=0x200BA)
2005/06/17-05:10:08 Append Process (AppName=RunDll32.exe,PID=1424,WndHandle=0x10156)
2005/06/17-05:10:08 Append Process (AppName=TpKmapMn.exe,PID=1456,WndHandle=0x300B0)
2005/06/17-05:10:08 Append Process (AppName=mm_tray.exe,PID=1352,WndHandle=0x102E4)
2005/06/17-05:10:08 Append Process (AppName=TPONSCR.exe,PID=1408,WndHandle=0x40108)
2005/06/17-05:10:08 Append Process (AppName=pccguide.exe,PID=1480,WndHandle=0x50270)
2005/06/17-05:10:08 Append Process (AppName=PCClient.exe,PID=1500,WndHandle=0x10168)
2005/06/17-05:10:08 Append Process (AppName=TMOAgent.exe,PID=1432,WndHandle=0x1017C)
2005/06/17-05:10:08 Append Process (AppName=qttask.exe,PID=1516,WndHandle=0x30128)
2005/06/17-05:10:08 Append Process (AppName=iTunesHelper.exe,PID=1532,WndHandle=0x1019C)
2005/06/17-05:10:08 Append Process (AppName=Internat.exe,PID=1540,WndHandle=0x10194)
2005/06/17-05:10:08 Append Process (AppName=AcroTray.exe,PID=1556,WndHandle=0x1019A)
2005/06/17-05:10:08 Append Process (AppName=Fusen.exe,PID=1588,WndHandle=0x20254)
2005/06/17-05:10:08 Append Process (AppName=WTM.exe,PID=1612,WndHandle=0x101B2)
2005/06/17-05:10:08 Append Process (AppName=husen.exe,PID=1648,WndHandle=0x50268)
2005/06/17-05:10:08 Append Process (AppName=INAZUMA.exe,PID=1664,WndHandle=0x1026A)
2005/06/17-05:10:08 Append Process (AppName=Hidemaru.exe,PID=1680,WndHandle=0x201AE)
2005/06/17-05:10:08 Append Process (AppName=Chibindar.exe,PID=1696,WndHandle=0x202AC)
2005/06/17-05:10:08 Append Process (AppName=HIDEMARU.EXE,PID=1576,WndHandle=0x10382)
2005/06/17-05:10:08 Append Process (AppName=SHMoa.exe,PID=1628,WndHandle=0x20238)
2005/06/17-05:10:08 Append Process (AppName=TLGrcJE4.exe,PID=1844,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=iPodService.exe,PID=1792,WndHandle=0x0)
2005/06/17-05:10:08 Append Process (AppName=hpbpage.exe,PID=1892,WndHandle=0x10528)
2005/06/17-05:10:08 Append Process (AppName=Loop1.exe,PID=1932,WndHandle=0x706C8)
2005/06/17-05:10:08 Append Process (AppName=Loop2.exe,PID=1380,WndHandle=0x706B8)
2005/06/17-05:10:08 Append Process (AppName=Terminator.exe,PID=1308,WndHandle=0x504B8)
2005/06/17-05:10:08 <---- EnumProcesses
2005/06/17-05:10:08 ----> LoadParameter
2005/06/17-05:10:08 Append Parameter (AppName=Loop1.exe)
2005/06/17-05:10:08 Append Parameter (AppName=Loop2.exe)
2005/06/17-05:10:08 <---- LoadParameter
2005/06/17-05:10:08 ----> Terminate
2005/06/17-05:10:08 Find Process (AppName=Loop1.exe) ...
2005/06/17-05:10:08 Post Quit Message to Process (PID=1932,WndHandle=0x706C8)
2005/06/17-05:10:08 Terminate Process (PID=1932,Handle=0xA4)
2005/06/17-05:10:08 <---- Terminate
2005/06/17-05:10:08 ----> Terminate
2005/06/17-05:10:08 Find Process (AppName=Loop2.exe) ...
2005/06/17-05:10:08 Post Quit Message to Process (PID=1380,WndHandle=0x706B8)
2005/06/17-05:10:09 <---- Terminate
2005/06/17-05:10:12 Terminator Finish!

posted by guy at 06:39 | 運用管理編
×

この広告は1年以上新しい記事の投稿がないブログに表示されております。