|
-
December 19th, 2010, 01:21 AM
#1
how can i customise my own file extension format?
i have a program i created in c++. its a logon application that i want to use to protect private files.
i would like to know how to create my own file extentions so that only my program can open it.
for example if i double click the file, my application opens and the user logs in, if the correct credentials
are entered they are allowed access to the file (it opens so they can read it).
at the moment my program opens up a word document when the user enters his correct credentials.
i am using the system() function for this. however this file when clicked from the start menu opens up using word.
basically i'm not sure what is best or whats right. is it best to just change the file extension so only my app can open it?
or create and save a document in a custom file format so that only my program can open it and other applications cannot read them?
if the latter, how can i do this, what are the steps?
plus i have looked up on some info online and it says that i have to register my file. does this relate to just
changing the file extension or creating a file format or both? How do i register my own file extension
Last edited by katy_price; December 19th, 2010 at 01:41 AM.
-
December 19th, 2010, 05:52 AM
#2
Re: how can i customise my own file extension format?
If you can use MFC then CWinApp::RegisterShellFileTypes will help you.
If not - see How to: Register Editor File Types
Note, however, that you cannot prevent user to change the default application to open your file type.
Victor Nijegorodov
-
December 19th, 2010, 10:06 AM
#3
Re: how can i customise my own file extension format?
can you just tell me simply how to create my own file extension for the file i have or a new one please?
-
December 19th, 2010, 10:09 AM
#4
Re: how can i customise my own file extension format?
I cannot do it better than Microsoft does it in MSDN.
Victor Nijegorodov
-
December 19th, 2010, 08:07 PM
#5
Re: how can i customise my own file extension format?
 Originally Posted by VictorN
I cannot do it better than Microsoft does it in MSDN.
hey, i have managed to create a file association by creating my own file extension. i have registered the new file extension and everything is fine that side. when i click a file with my extension my program now opens. however. my program is a login system a user must enter their username and password to see the actual content of the file. how do i do this? am i required to create some sort of code in my program? if so what code?
plus i am able to change what the program is associated to via control panel >program >default program >set associations in windows 7, is there away of getting round this?
thanks
Last edited by katy_price; December 19th, 2010 at 08:24 PM.
-
December 20th, 2010, 04:42 AM
#6
Re: how can i customise my own file extension format?
You might look into custom file compression - you create a special type of file compression that only your program knows the pattern of... (encryption)
Something along the lines of simply changing the file size by removing certain characters in a certain order - and replacing them with your custom file handler to access it...
This is just speculation because I have no idea how to do it - but I know that it is plausible. I believe that would solve your dilemma of users simply associating the file with the necessary program to open the protected file with just a different extension.
If it was too easy then everyone would do it.
-
February 21st, 2011, 09:23 PM
#7
Re: how can i customise my own file extension format?
You have two separate problems.
1. File association (now solved but with the caveat that it can be changed)
2. Preventing other software from "interpreting" NOT reading the contents of the file.
This is an important distinction. Anyone can use a binary file editor to OPEN and READ your file. The problem is making sure the contents are not actually interpretable. To achieve that you will need to do as Morbane suggested and use an encryption scheme.
-
February 21st, 2011, 09:24 PM
#8
Re: how can i customise my own file extension format?
Here is a commercial product that does what you are describing http://www.newsoftwares.net/folderlock/
-
February 21st, 2011, 09:29 PM
#9
Re: how can i customise my own file extension format?
You can only prevent users from changing the file NAME through the use of an Access Control List.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|