Search results for 'GENERIC_READ'. 1 post(s) found.
- 2007/09/10 Checking If File Is In Use
IsFileInUse will return true if the file is locked for exclusive access. It would fail if the file doesn't exist at all.
function IsFileInUse(fName : string) : boolean;
var
HFileRes : HFILE;
begin
Result := false;
if not FileExists(fName) then exit;
HFileRes :=
CreateFile(pchar(fName),
GENERIC_READ or GENERIC_WRITE,
0, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0) ;
Result := (HFileRes = INVALID_HANDLE_VALUE) ;
if not Result then
CloseHandle
end;
var
HFileRes : HFILE;
begin
Result := false;
if not FileExists(fName) then exit;
HFileRes :=
CreateFile(pchar(fName),
GENERIC_READ or GENERIC_WRITE,
0, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0) ;
Result := (HFileRes = INVALID_HANDLE_VALUE) ;
if not Result then
CloseHandle
end;
Another posts included in "Delphi"
| Convert a mapped drive to a full UNC path (0) | 2007/09/10 |
| Does my CD-ROM drive contain an audio CD? (0) | 2007/09/10 |
| Delete files with the ability to UNDO (0) | 2007/09/10 |
| Browse for Computers, Folders, Files and Printers (0) | 2007/09/10 |
| How to draw Transparent Text on bitmap (0) | 2007/09/01 |
| How Do I Remove The Application Icon From The Taskbar? (0) | 2007/08/25 |
| How To Show The Print Dialog And Print Text Files (0) | 2007/08/25 |
| How To Make An Animated Application Icon (0) | 2007/08/25 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 23:31
moneyideas
-
Subject different money making ideas
2010/01/29 07:50
moneyideas
-
Subject different money making ideas
2010/01/31 16:38
moneyideas

Prev

Rss Feed