Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

I am New to delphi and i need some help

Hi i am new to delphi and i want to now 1 simple commands (well i believe they will be simple to someone who knows what delphi is about)i want to know the code so the computer will restart after i have installed my programme. basically i just want the command to restart the computer. please help as i need it for my first project
from
mark and is there a piece of code that will format the hard drive with out the user pressing yes or no so in other words just by pushing one button the hard drive will format as i want to make my self a format disk i dont no if it can be done though please help

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi i am new to delphi and i want to now 1 simple commands (well i believe they will be simple to someone who knows what delphi is about)i want to know the code so the computer will restart after i have installed my programme. basically i just want the command to restart the computer. please help as i need it for my first project
    : from
    : mark and is there a piece of code that will format the hard drive with out the user pressing yes or no so in other words just by pushing one button the hard drive will format as i want to make my self a format disk i dont no if it can be done though please help
    :
    You can use the ShellExecute() API call (see windows SDK help files for details) to call DOS's format.
    To reboot the computer you need to use the ExitWindowsEx() API call, again detailed in the windows SDK help files.
  • markblue777markblue777 Member Posts: 184
    thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
  • zibadianzibadian Member Posts: 6,349
    : thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
    :
    Here is the code to format. The reboot code is much easier, so I'll leave that to you.
    [code]
    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ShellExecute(Handle, nil, 'format.exe', 'a:', nil, SW_SHOWNA);
    end;
    [/code]
  • markblue777markblue777 Member Posts: 184
    : : thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
    : :
    : Here is the code to format. The reboot code is much easier, so I'll leave that to you.
    : [code]
    : procedure TForm1.Button1Click(Sender: TObject);
    : begin
    : ShellExecute(Handle, nil, 'format.exe', 'a:', nil, SW_SHOWNA);
    : end;
    : [/code]
    :
    is that code to format the a drive if i want to format the hardrive do i just change letters and plz tell me the rebot one or where i can get some infor on it cos i only got this programme yesturday plz help
  • markblue777markblue777 Member Posts: 184
    : : thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
    : :
    : Here is the code to format. The reboot code is much easier, so I'll leave that to you.
    : [code]
    : procedure TForm1.Button1Click(Sender: TObject);
    : begin
    : ShellExecute(Handle, nil, 'format.exe', 'a:', nil, SW_SHOWNA);
    : end;
    : [/code]
    :
    will this code format the hard drive without consent from the user if it does not wot can i do to make it format the hard drive with out consent from the user
  • zibadianzibadian Member Posts: 6,349
    : : : thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
    : : :
    : : Here is the code to format. The reboot code is much easier, so I'll leave that to you.
    : : [code]
    : : procedure TForm1.Button1Click(Sender: TObject);
    : : begin
    : : ShellExecute(Handle, nil, 'format.exe', 'a:', nil, SW_SHOWNA);
    : : end;
    : : [/code]
    : :
    : will this code format the hard drive without consent from the user if it does not wot can i do to make it format the hard drive with out consent from the user
    :
    This code is the same as opening a DOS window and type "format a:", but then the program perfroms the typing. Also its very bad form to format a harddrive witout letting the user know you're doing it, or giving him a chance to confirm his action.
    As for the ExitWindowsEx() function: in the Delphi menu select "Help|Windows SDK", and look it up. If you don't know how to use the help, then this kind of programming is way to advanced for you.
  • markblue777markblue777 Member Posts: 184
    : : : : thanks for the help is the code easy to put in or even better could u send me the souce code i will need to use plz as i would be very great ful
    : : : :
    : : : Here is the code to format. The reboot code is much easier, so I'll leave that to you.
    : : : [code]
    : : : procedure TForm1.Button1Click(Sender: TObject);
    : : : begin
    : : : ShellExecute(Handle, nil, 'format.exe', 'a:', nil, SW_SHOWNA);
    : : : end;
    : : : [/code]
    : : :
    : : will this code format the hard drive without consent from the user if it does not wot can i do to make it format the hard drive with out consent from the user
    : :
    : This code is the same as opening a DOS window and type "format a:", but then the program perfroms the typing. Also its very bad form to format a harddrive witout letting the user know you're doing it, or giving him a chance to confirm his action.
    : As for the ExitWindowsEx() function: in the Delphi menu select "Help|Windows SDK", and look it up. If you don't know how to use the help, then this kind of programming is way to advanced for you.
    :

    Thanks very much for all of your help is there a bit of code though so the user does not have to confirm it
Sign In or Register to comment.