1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
program exportdeals;
uses
ShareMem,
Forms,
Windows,
FM_Main in 'FM_Main.pas' {F_Main};
var
Mutex : THandle;
{$R *.res}
begin
ExportDealRestoreMsg := Windows.RegisterWindowMessage('Export des Deals');
Mutex := CreateMutex(nil, True, 'Export des Deals');
if (Mutex <> 0) and (GetLastError = 0) then
begin
try
Application.Initialize;
Application.CreateForm(TF_Main, F_Main); // createform est une fonction implémentée dans la form TF_Main
Application.Run;
finally
if Mutex <> 0 then
CloseHandle(Mutex);
end;
end
else
SendMessage(HWND_BROADCAST, ExportDealRestoreMsg, 0, 0);
end. |
Partager