RE: Determine if a File is Open

2022-04-01 Thread Carl Lindner
Subject: Re: Determine if a File is Open Probably the easiest way is just trying to open it and trapping the error. So assuming you know the file exists then lnHandle = fopen(lcMyFileName) if lnHandle = -1 * -- The file couldn't be opened so is open somewhere else. else f

Re: Determine if a File is Open

2022-03-29 Thread Alan Bourke
Probably the easiest way is just trying to open it and trapping the error. So assuming you know the file exists then lnHandle = fopen(lcMyFileName) if lnHandle = -1 * -- The file couldn't be opened so is open somewhere else. else fclose(lnHandle) endif To close it you would ha

Determine if a File is Open

2022-03-29 Thread Carl Lindner
I extracted "d:\test_dir\test.pdf". Then used ShellExecute to open it. The user reads the pdf and later I want to erase it. But, it will not erase if the user has not previously closed it. How can I tell if it is closed? Even better, is there a way I can close it? Carl Lindner --- St