Howdy, Stranger!

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

Categories

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

  • Josh CodeJosh Code Member Posts: 675
    : 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]


  • Shawn CarterShawn Carter Member Posts: 0

    _______ [ http://forcoder.org ] free video tutorials and ebooks about < Swift, Perl, Assembly, Java, C#, Go, R, Delphi, Ruby, Scratch, MATLAB, Visual Basic, Objective-C, PHP, C, PL/SQL, C++, Python, Visual Basic .NET, JavaScript Erlang, Logo, Ada, Crystal, ML, Alice, Lisp, SAS, D, Scheme, Transact-SQL, Lua, Bash, Scala, Prolog, COBOL, Dart, Julia, Hack, LabVIEW, FoxPro, F#, Apex, Kotlin, Clojure, Awk, Fortran, ABAP, Rust, VBScript /> _

Sign In or Register to comment.