GetModuleName (Delphi)
Description
This example requires a button and a label. When you click the button, the GetModuleName function retrieves the path and name of the project executable using the file handle HInstance.
Code
function GetUsersFileName: string;
begin
Result := SysUtils.GetModuleName(HInstance);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := GetUsersFileName;
end;
Uses
- System.SysUtils.GetModuleName ( fr | de | ja )