Quelltext
1:
| Result := ShellExecute(Application.MainForm.Handle, nil, StrPCopy(zFileName, FileName), StrPCopy(zParams, Params), StrPCopy(zDir, DefaultDir), ShowCmd); |
Result ist ein THandle.
Wenn dir das zu schwer ist fügst du in dein Projekt einfach die Datei fmxutils.pas ein. Die findest du in deinem Delphi Ordner unter \Demos\Doc\Filmanex. Du kannst das durch anklicken des Icons mit dem grünen Pluspfeil neben dem Save Icon in dein Projekt einfügen.
So dann musst du in deinem Code in der uses Klausel das wort "fmxutils" einfügen. So ungefähr:
Quelltext
1: 2: 3:
| uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, fmxutils; |
So, dann kannst du per Knopfdruck einen Ordner öffnen:
Quelltext
1:
| ExecuteFile('c:\windows', '', '', 0); |
oder den Browser:
Quelltext
1:
| ExecuteFile('http://www.hardtware.de', '', '', 0); |
oder eine Anwendung
Quelltext
1:
| ExecuteFile('c:\windows\notepad.exe', 'c:\autoexec.bat', 'c:\', 0); |