function IsFileInUse(AName: string): boolean;
var
hFileRes: HFILE;
begin
Result := False;
if not FileExists(AName) then exit;
hFileRes := CreateFile(PChar(AName), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
Result := hFileRes = INVALID_HANDLE_VALUE;
if not Result then
CloseHandle(hFileRes);
end; 此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/70685.html
var
begin
end; 此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/70685.html