Quote: "@RalphY: tryed that one, but it getting me the size in KBytes"
Well, here it returns the size in bytes for me.
Quote: "err.. should it be something?
i just used var handle:THandle should i do somethingh else with it?
and i remember i used the CreateFile commands and then using it to get the handle and all. but its always returned me -1"
Well you need to fill that handle with a proper value.
procedure TForm1.Button1Click(Sender: TObject);
var
hFile: THandle;
f: file of Byte;
size: Longint;
begin
if OpenDialog1.Execute then
begin
hFile := CreateFile(PChar(OpenDIalog1.Filename), GENERIC_READ, 0, nil, OPEN_EXISTING, 0, 0);
size := GetFileSize(hFile, nil);
CloseHandle(hFile);
end;
ShowMessage(IntToStr(size));
end;