procedure TForm1.Button1Click(Sender: TObject);<br>var<br> h : THandle;<br> lpReOpenBuff: TOFStruct;<br> Buffer : Pointer;<br> lpNumberOfBytesRead: DWORD;<br>Const<br> MAX_BUFFERSIZE = $FFFF;<br>begin<br> h := OpenFile('FileName', lpReOpenBuff, OF_READWRITE);<br> if h <> HFILE_ERROR then<br> begin<br> //SetFilePointer(h, 100, nil, FILE_BEGIN);<br> GetMem(Buffer, MAX_BUFFERSIZE);<br> ReadFile(h, Buffer^, MAX_BUFFERSIZE, lpNumberOfBytesRead, nil);<br> FreeMem(Buffer, MAX_BUFFERSIZE);<br> CloseHandle(h);<br> end;<br>end;