was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

41 Visitors Online


 
...das eigene Programm Verzeichnis ermitteln ?
Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch
[ Tip ausdrucken ]  

Tip Bewertung (57):  
     


{
  To get your program's directory:
  Das eigene Programm Verzeichnis/(den Anwendungspfad) ermitteln:
}

procedure TForm1.Button1Click(Sender: TObject);
var
  
sExePath: string;
begin
  
sExePath := ExtractFilePath(Application.ExeName)
    ShowMessage(sExePath);
end;

{
  To get your program's Exe-Name:
  Und den Exe-Name:
}

procedure TForm1.Button2Click(Sender: TObject);
var
  
sExeName: string;
begin
  
sExeName := ExtractFileName(Application.ExeName);
  ShowMessage(sExeName);
end;


{
  Instead of Application.ExeName you can also use Paramstr(0)
  Anstatt Application.ExeName kann man auch Paramstr(0) einsetzen
}

{
  If you are working on a DLL and are interested in the filename of the
  DLL rather than the filename of the application, then you can use this function:
}

function GetModuleName: string;
var
  
szFileName: array[0..MAX_PATH] of Char;
begin
  
FillChar(szFileName, SizeOf(szFileName), #0);
  GetModuleFileName(hInstance, szFileName, MAX_PATH);
  Result := szFileName;
end;

 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners