Tech-Ecke / Delphi Inhalt / ShellExecute |
|
Anwendungen starten, Website, eMail
Anwendungen StartenStarten einer Anwendung
– benötigt ShellAPI
in uses!
|
ShellExecute(Handle,PChar('open'),PChar('notepad.exe'),nil,nil,SW_SHOW); |
ShellExecute(Handle,PChar('runas'),PChar('regedit.exe'),nil,nil,SW_SHOW); |
ShellExecute(Handle, PChar('open'),PChar('C:\datei.txt'), nil, nil, SW_SHOW) |
ShellExecute(Handle, PChar('explore'),PChar('C:\Windows'), nil, nil, SW_SHOW) |
Öffnen einer Datei mit einer angegebenen Anwendung – benötigt ShellAPI in uses!
ShellExecute(0, PChar('open'),PChar('c:\windows\notepad.exe'),PChar('Datei.txt'),'c:\',SW_SHOW); |
ShellExecute(Application.MainForm.Handle,nil,PChar('C:\Dosanwendung.exe'),PChar('
> c:\dir.txt'),nil,SW_SHOW); //oder ShellExecute(Handle, 'open',PChar('CMD'),PansiChar(' /c C:\Dosanwendung.exe > c:\dir.txt'),nil,SW_SHOW); |
Website aufrufen – benötigt ShellAPI in uses!
ShellExecute(Handle, PChar('open'),PChar('http://www.tech-ecke.de'), nil, nil, SW_SHOW); |
eMail versenden – benötigt ShellAPI in uses!
ShellExecute(Handle, PChar('open'),PChar('mailto:name@adresse.de'), nil, nil, SW_SHOW); |
Die Option Drucken funktioniert erst ab Netscape V4.0 bzw. I-Explorer 5.0 !
[letzte Aktualisierung 09.10.2006]