How to make File Copy Protect using WIN32

Hello..

I have created a file using Core WIN32 & code is like this :



HANDLE hFile = CreateFile("E:\\FileName123.txt", GENERIC_READ,0,0,OPEN_ALWAYS, FILE_ATTRIBUTE_READONLY, 0);


This will create a file with name FileName123 in E:Drive.

My question is: When it will create the file in E:Drive, it must become Copy Protect. That is., File should not copy to other location.

Please can u suggest any solution for this ..

Thanks..
My advice is to encrypt file content if it is very important to you, there is absolutely NO WAY to make a file non-copyiable.
If it can be opened, it can be copied. There is no protection like this built-in to ntfs/fat32 filesystem driver.
Well, in NTFS you can set permissions. If yo deny access to the file you are effectively disallowing copy. But if the user needs to at least view the contents, then this doesn't work.
Topic archived. No new replies allowed.