This smample show how to start only one instance of software per client machine
first in Your myapplication.dpr write this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
program myProject; uses Forms, Windows, Dialogs, // other forms initialization... var Mutex: THandle; begin Mutex := CreateMutex (nil, True, 'Cashier2010'); if (Mutex = 0) or (GetLastError = ERROR_ALREADY_EXISTS) then begin ShowMessage ('Application is active'); end else begin Application.Initialize; ..//create form and run end; end. |