Errorcodes if Open files

Allan_Fernandes
Allan_Fernandes used Ask the Experts™
on

Hi,

I need to indicate to user that files are open (eg: MSoutlook.exe is running therefore PST's are open). Can I safely assume that I can trap $20 and $33 or could there be more errorcodes ?

1)
  { The process cannot access the file because it is being used by another process. }
  ERROR_SHARING_VIOLATION = $20;
  {$EXTERNALSYM ERROR_SHARING_VIOLATION}
2)
  { The process cannot access the file because }
  { another process has locked a portion of the file. }
  ERROR_LOCK_VIOLATION = 33;
  {$EXTERNALSYM ERROR_LOCK_VIOLATION}

Regards
Allan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
use
try except for error trapping
including there Raising exceptions

http://www.delphibasics.co.uk/Article.asp?Name=Exceptions

Author

Commented:
Hi,

My application cannot disturb the user except on 'Open Error'. For other errors I have to fill a log and continue silently.

Regards
Allan
I will use $20 and $33 as of now

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial