Save the database in the system registry
This procedure saves the database of the register of the sistema:procedure TForm1.SaveRegister(iTimeOutMs: DWORD; sFileName: SHortString); Var Ticks: DWord; StartInfo: TStartupInfo; ProcessInfo: TProcessInformation; End: Boolean; Begin FillChar (StartInfo, SizeOf (StartInfo), #0); StartInfo.cb: = SizeOf (StartInfo); If CreateProcess (Nil, PChar('regedit.exe /se ' +sFileName), Nil, Nil, False, 0, Nil, Nil, StartInfo, ProcessInfo) Then Begin ShowMessage('Guardando la BD...) '); Ticks: = GetTickCount; End: = False; Repeat Case WaitForSingleObject(ProcessInfo.hProcess, 200) Of WAIT_OBJECT_0: end: = True; End; Application.ProcessMessages; Prevents the application blocking Sleep (250); Until (end) Or (GetTickCount - tick > iTimeOutMs); If (end = False) Then ShowMessage('TimeOut!) Not done correctly... ') Else ShowMessage('Se ha guardado la BD.) ') End else ShowMessage('Error ael inciar el guardado de la BD!) '); end; Their
Weiterlesen... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:28 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz