How you use the lockfile?

Please discuss general Delphi programming topics here.

How you use the lockfile?

Postby warfighter » March 17th, 2009, 6:02 pm

How you use the lockfile ?

function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): BOOL; stdcall;


I would like to know how to use this function in delphi ?

Bye
warfighter
Active Member
Active Member
 
Posts: 11
Joined: March 17th, 2009, 5:56 pm

Re: How you use the lockfile?

Postby Kambiz » March 17th, 2009, 7:27 pm

This function locks a portion of a file. You pass handle of the file, start offset (64bit), and number of bytes (64bit) to lock as parameter. That's all.

The only thing you have to consider is that when you open or create the file, do not deny any sharing. Otherwise, the entire file is already locked.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: How you use the lockfile?

Postby warfighter » March 19th, 2009, 2:18 pm

how to do this with my file ?????
example: the file that runs it does not want read by a program or out unless his own windows xp

bye 8)
warfighter
Active Member
Active Member
 
Posts: 11
Joined: March 17th, 2009, 5:56 pm

Re: How you use the lockfile?

Postby Kambiz » March 19th, 2009, 3:08 pm

Sorry, I didn't get what you mean. What are you going to do?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: How you use the lockfile?

Postby warfighter » March 19th, 2009, 10:52 pm

I know how to use this feature 8)
warfighter
Active Member
Active Member
 
Posts: 11
Joined: March 17th, 2009, 5:56 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron