Adesso funziona ho modificato cosi il codice:
codice:procedure TForm1.CambiaClick(Sender: TObject); var buttonSelected : Integer; begin SysSetComputerName (PC.Text); StatusBar.Panels[2].Text:='Nome PC Cambiato'; // Mostri un dialogo di conferma buttonSelected := MessageDlg('Le Modifiche Diverrano Effettive Dopo Il Riavvio Del PC', mtWarning, mbOKCancel, 0); // Mostri il tipo di tasto selezionato if buttonSelected = mrOK then if not ExitWindows(EWX_POWEROFF or EWX_FORCE,0) then if not buttonSelected = mrCancel then ShowMessage('Operazione Annullata'); end;

Rispondi quotando