GetModuleName (C++)
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
String __fastcall GetUsersFileName(void)
{
return GetModuleName(unsigned(HInstance));
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Label1->Caption = GetUsersFileName();
}
Uses
- System.SysUtils.GetModuleName ( fr | de | ja )