Tad писал(а):
Всё. Пошли спатьГы. Последняя редакция. Еще ускорил
procedure THIListBox._work_doLoad;
var
s, fn: string;
F: TextFile;
fsz: cardinal;
hFile: THandle;
BufIn : Array[0..65535] of Char;
begin
fn := ReadString(_Data,_data_FileName,_prop_FileName);
if FileExists(fn) then
begin
Control.Perform(WM_SETREDRAW, 0, 0);
Control.Clear;
hFile := CreateFile(PChar(fn), GENERIC_READ OR GENERIC_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE, nil,
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0);
fsz := GetFileSize(hFile, nil);
CloseHandle(hFile);
if fsz <> 0 then
begin
AssignFile(F, fn);
Reset(F);
SetTextBuf (F, BufIn);
if fsz > MAX_PATH * 100 then Control.Perform(LB_INITSTORAGE, 0, fsz);
while not eof(F) do
begin
Readln(F, s);
Control.Perform(LB_ADDSTRING, 0, cardinal(PChar(s)));
end;
CloseFile(F);
end;
Control.Perform(WM_SETREDRAW, 1, 0);
_hi_CreateEvent(_Data,@_event_onChange);
end;
end;