|
no abrir el programa mas de una vez
program Projec;
uses
Forms,
Messages,
Dialogs,
Windows,
shellapi,
Proyecto in 'Proyecto.pas' {Form1},
const
NombreMutex='SIGH';
var MiMutex:Thandle;
{$R *.res}
begin
mimutex:= CreateMutex(nil,true,NombreMutex);
if MiMutex=0 then
begin
Showmessage('Erro ao criar o projeto');
halt;
end;
if GetLastError=ERROR_ALREADY_EXISTS then
begin
Showmessage('O Programa já está aberto');
halt;
end;
Application.Initialize;
TStyleManager.TrySetStyle('Iceberg Classico');
Application.Title := 'Sistema de Facturaçao';
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
|