procedure TForm1.Button2Click(Sender: TObject); var h1,h2: Thandle; buf: ^Byte; size: cardinal; tmplen: int64; begin h1 := fileOpen(ExtractFilepath(Paramstr(0)) + '0.bmp', fmOpenRead); h2 := FileCreate(extractFilePath(paramStr(0))+'0_out.bmp'); if (h1 = -1) or (h2 = - 1) then begin if h1 <> -1 then fileClose(h1); if h2 <> -1 then fileClose(h2); raise Exception.Create('文件打开失败!'); end;