Einzelnen Beitrag anzeigen

Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
15.007 Beiträge
 
#1

Save the database in the system registry

  Alt 30. Jun 2018, 23:33
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...
  Mit Zitat antworten Zitat