Hi,
How avoid Vista system Message Box "File already used" when atempt open a file opened by another process (i.e. file opened but not closed).
I have used OpenDialog and VistaOpenSaveDlg with same results.
On xp i can handle any errors, how do it on vista?
if (VistaOpenSaveDialog(Handle, '', '', '', 'Open existing file', fileName,
OFN_FILEMUSTEXIST, VDT_OPENDIALOG)) = True then begin
ShowMessage(fileName);
fn:=fileName;
if IsFileInUse(fn) then begin
ShowMessage('Can not open file');
end
else begin
ShowMessage('File opened ok');
AssignFile(ft, fn);
Reset(ft, 1);
FillListBox; // do something with file contents
CloseFile(ft);
fOpen:=False;
end;
end
else ShowMessage('Dialog Cancelled');
Thanks
Jolix