File locking?

Ok so I was wondering how i would make a lock for a certain program, lets say a text document. The program would open when the user tried to open the document and ask for a password, and if the password is entered correctly then it will open and obviousley if it isnt it wont. How many lines would a program like this be? can i do it in just plain c++ or do i need to use Winapi? Im almost positive i need to use win api thats why i posted here, but idk.
Last edited on
Yes, I also think that will need WinAPI
No, you don't need to use winapi if you use a cryptographic library like Crypto++ or whatever.

Microsoft already has their own Crypto API, but that obviously requires winapi.
So I wouldnt be able to lock a file with just plain c++ combined with a little winapi?
Yes, of course you can. I just said you have either posibility to use a cross-platform solution or a Microsoft solution.

The choice is yours.
Ok, so where are some tutorials on how I could accomplish this with c++ and win api?
Topic archived. No new replies allowed.