一、声明(方式有两种):
1. function PathFileExists(pszPath:string):Bool;stdcall;external 'shlwapi.dll'Name'PathFileExistsA';
2. function PathFileExistsA(pszPath:string):Bool;stdcall;external 'shlwapi.dll';
2. function PathFileExistsA(pszPath:string):Bool;stdcall;external 'shlwapi.dll';
二、使用(此处用第二种方式)://该函数的返回值为布尔型,0 或1,
if not PathFileExistsA('f:\pascal教程.doc') then
ShowMessage('File not find!')
else
showmessage('File exists!');
ShowMessage('File not find!')
else
showmessage('File exists!');