Delphi - Cerrar todas las aplicaciones

 
Vista:

Cerrar todas las aplicaciones

Publicado por Jose (1 intervención) el 08/01/2001 00:00:00
Como puedo cerrar todas las applicaciones abiertas en el momento? (y si es posible dejar algunas abiertas.)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Cerrar todas las aplicaciones

Publicado por Tamara (6 intervenciones) el 23/02/2001 13:36:24
La solucion es determinar que prog exe eatan corriendo y luego cerrarlos.
Mas o menos asi:
CREA TU FORM MAS DOS BUTTON'S Y EL TEXT TOTAL DE LA UNIT ES COMO SIGUE:
unit uni_pri;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
ProgramasAntes : TStringList;
procedure GuardaInstante(const Lista:TStringList);
procedure MataLosQueSobran(const Antes:TStringList);
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
ProgramasAntes:=TStringList.Create;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
ProgramasAntes.Free;
end;

procedure TForm1.GuardaInstante(const Lista:TStringList);
function SacaExe(MangoW:HWND):string;
{Obtiene el EXE de una tarea}
{get EXE of a task}
var
Datos :TProcessEntry32;
hID : DWord;
Snap : Integer;
begin
GetWindowThreadProcessId(MangoW,@hID);
Snap:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS%
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar