home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / MONITOR.DPR < prev    next >
Text File  |  1996-05-08  |  736b  |  35 lines

  1. program monitor;
  2.  
  3. uses
  4.   Forms,
  5.   Windows,
  6.   IPCThrd in 'IpcThrd.pas',
  7.   MonForm in 'MonForm.pas' {MonitorForm},
  8.   TrcView in 'TrcView.pas' {TraceForm};
  9.  
  10. {$R *.RES}
  11.  
  12. { This routine checks for a previous instance of the monitor and if one is
  13.   found, brings it to the foreground and then exits }
  14.  
  15. procedure CheckPreviousInstance;
  16. var
  17.   H: THandle;
  18. begin
  19.   if IsMonitorRunning(H) then
  20.   begin
  21.     if IsIconic(H) then
  22.       ShowWindow(H, SW_RESTORE);
  23.     SetForegroundWindow(H);
  24.     Halt(0);
  25.   end;
  26. end;
  27.  
  28. begin
  29.   CheckPreviousInstance;
  30.   Application.Title := 'IPC Monitor Demo';
  31.   Application.CreateForm(TMonitorForm, MonitorForm);
  32.   Application.CreateForm(TTraceForm, TraceForm);
  33.   Application.Run;
  34. end.
  35.