FormMain.Caption:=getcurpath(application.Handle);
//获得当前应用程序所在路径
function getcurpath(hwnd_application:integer): string;
begin
setlength(result,128);
GetModuleFileName(hwnd_application, pchar(result), 128)
end;
//获得当前应用程序所在路径
function getcurpath(hwnd_application:integer): string;
begin
setlength(result,128);
GetModuleFileName(hwnd_application, pchar(result), 128)
end;
GetModuleFileName(0, pchar(result), 128)
begin
path:=ExtractFilePath(Application.ExeName);
beging
getdir(0,currentdir);
showmessage(currentdir);
end;