Returns the fully qualified name for a module, given its handle.
function GetModuleName(Module: HMODULE): string;
AnsiString GetModuleName(HMODULE Module);
Call GetModuleName to obtain the fully qualified name of a module, given its handle.
Module is the handle of the module whose file name is required.
C++ Examples:
/* This example requires a button and a label. When the user clicks the button, the GetModuleName function retieves the path and name of the project executable using the file handle HInstance. */ AnsiString __fastcall GetUsersFileName(void) { return GetModuleName(unsigned(HInstance)); } void __fastcall TForm1::Button1Click(TObject *Sender) { Label1->Caption = GetUsersFileName(); }
Delphi Examples:
{ This example requires a button and a label. When the user clicks the button, the GetModuleName function retieves the path and name of the project executable using the file handle HInstance. } function GetUsersFileName: string; begin Result := SysUtils.GetModuleName(HInstance); end; procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := GetUsersFileName; end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|