How do you run Windows apps from Delphi code???

How do you run Windows apps from Delphi code???
Say I wanted to Run Scandisk if I got any exceptions in my code (not that this would be real or practical of course), how would I go about calling it?

Comments

  • : How do you run Windows apps from Delphi code???
    : Say I wanted to Run Scandisk if I got any exceptions in my code (not that this would be real or practical of course), how would I go about calling it?
    :

    Here is a function that will open any file type by just specifying the file and a default directory.

    To run other programs, just give the function the name of the exe file. Other file types would just be loaded in the associated program. For example, a bitmap file might be opened in MS Paint.

    [code]
    [b]function[/b] ExecuteFile(FileName, DefaultDir: string): HWND;
    [b]begin[/b]
    Result := ShellExecute(form1.handle,nil,PChar(FileName), '',
    PChar(DefaultDir), SW_SHOWNORMAL);
    [b]end;[/b]
    [/code]


Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion