![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#10
|
|||
|
|||
|
Hola, yo uso este codigo en todos mis programas y funciona bien, sin dejar procesos en memoria:
Código:
public
constructor Create(AOwner: TComponent); override;
//======================================================================================================================
constructor TfrmMain.Create(AOwner: TComponent);
//======================================================================================================================
type
PHWND = ^HWND;
var
createerror: DWORD;
FHMapObject: Integer;
begin
FHMapObject := CreateFileMapping(
$FFFFFFFF, // use paging file
nil, // no security attributes
PAGE_READWRITE, // read/write access
0, // size: high 32-bits
1, // size: low 32-bits
PChar('Nombre_de_tu_programa')); // name of map object
createerror := GetLastError;
if FHMapObject = 0 then
begin
MessageDlg(Format('CreateFileMapping=$%x', [createerror]),
mtError, [mbOK], 0);
Exit;
end;
if GetLastError = ERROR_ALREADY_EXISTS then
begin
CloseHandle(FHMapObject);
MessageDlg('Ya hay una instancia ejecutandose', mtError, [mbOK], 0);
Application.Terminate;
Halt;
end;
Inherited;
end;
Jorge |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| alguien tiene la unidad para evitar multiples instancias de Roman | ivantj24 | Varios | 11 | 29-07-2011 22:48:58 |
| como generar ventas multiples (seleccionar multiples items) | userdelphi | Varios | 4 | 30-12-2010 02:52:21 |
| Problema con Sesiones Http | yomismo24 | Internet | 0 | 08-04-2008 17:38:33 |
| Problema con RaveReports (multiples instancias) | az_jazo | Varios | 2 | 24-05-2006 17:55:03 |
| Problema con parámetros o sesiones | __cadetill | PHP | 8 | 17-11-2003 22:31:52 |
|