procedure TForm1.Button3Click (Sender: TObject); var ExitCode:? cardinal ;? ExecInfo:? TShellExecuteInfo; begin ZeroMemory (@ ExecInfo, SizeOf (ExecInfo)) ;? with ExecInfo do begin ??? cbSize: = SizeOf (ExecInfo); ??? fmask: = see_mask_nocloseprocess; ??? lpverb: = 'open'; ??? // lpfile: = 'cmd.exe'; ??? compmgmt.msc / s ??? lpfile: = 'compmgmt.msc '; ??? lpparameters: = pchar (' / s'); ??? wnd: = self.handle; ??? nshow: = sw_shownormal ;? end;
? ShellExecuteEx (@ExecInfo) ;? GetExitCodeProcess (ExecInfo.hProcess, ExitCode) ;? while ExitCode = STILL_ACTIVE do begin ??? GetExitCodeProcess (ExecInfo.hProcess, ExitCode); ??? sleep (10); ??? Application.ProcessMessages ; end ;? showMessage ('success!') end;