how to prevent a file from being opened?
-
Hi.. Is there a way to prevent a file from being opened in windows desktop .... The System is not a part of any network.. There is No other users except Administrator is available in the system. Thanks
Luck is Opportunity with hardwork
You can run a program which opens the file, which will lock other users from doing so. Why is this in the managed C++ forum ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
You can run a program which opens the file, which will lock other users from doing so. Why is this in the managed C++ forum ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
hi Thanks for the reply, Im writing this in c++ forum because i came to know that it is possible only in c++. IM developing an application which monitors the activities of the system.so whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file and it is through the application that we decide whether to allow access to the file or deny.The file should open only if the application grants access.Anyway if the application is sttoped the user should have access to the files. Any Ideas...
Luck is Opportunity with hardwork
-
hi Thanks for the reply, Im writing this in c++ forum because i came to know that it is possible only in c++. IM developing an application which monitors the activities of the system.so whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file and it is through the application that we decide whether to allow access to the file or deny.The file should open only if the application grants access.Anyway if the application is sttoped the user should have access to the files. Any Ideas...
Luck is Opportunity with hardwork
What Christian replied should work if you wanted to lock a file.
sundar156 wrote:
Im writing this in c++ forum because i came to know that it is possible only in c++.
Not quite true. Language is just a matter of choice or convenience. BTW, if you just want VC++, not C++/CLI, post your questions on "VC++/MFC" forum.
sundar156 wrote:
whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file
You may get a mouse click message, but how could you tell that the user is trying to open a file? Apparently this needs more thinking and design.
Best, Jun
-
hi Thanks for the reply, Im writing this in c++ forum because i came to know that it is possible only in c++. IM developing an application which monitors the activities of the system.so whenever a user double clicks on a file.The application which is monitoring the activities receives a message that a user is trying to open a file and it is through the application that we decide whether to allow access to the file or deny.The file should open only if the application grants access.Anyway if the application is sttoped the user should have access to the files. Any Ideas...
Luck is Opportunity with hardwork
sundar156 wrote:
Im writing this in c++ forum because i came to know that it is possible only in c++.
As has been said, this is not true, and in any case, you're not in the C++ forum but the C++/CLI one You may be able to write a system wide hook that establishes the attempt to open a file, but it sounds like it's going to be a complex task.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
sundar156 wrote:
Im writing this in c++ forum because i came to know that it is possible only in c++.
As has been said, this is not true, and in any case, you're not in the C++ forum but the C++/CLI one You may be able to write a system wide hook that establishes the attempt to open a file, but it sounds like it's going to be a complex task.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
Thanks for the reply, Yes it appears to be complex! And i have posted in lots of forums and i didnt get a feasible solution yet! In some they say it is only possible in Linux! Some say that it isnt possible,yet others say it is possible by API hooking.I have not done any hooks until now. but system wide hooks should be done using c++.Am i right? Anyway if this is not the right forum please tell where to post?
Luck is Opportunity with hardwork
-
Thanks for the reply, Yes it appears to be complex! And i have posted in lots of forums and i didnt get a feasible solution yet! In some they say it is only possible in Linux! Some say that it isnt possible,yet others say it is possible by API hooking.I have not done any hooks until now. but system wide hooks should be done using c++.Am i right? Anyway if this is not the right forum please tell where to post?
Luck is Opportunity with hardwork
sundar156 wrote:
In some they say it is only possible in Linux!
That is possible, because you're talking about something OS specific ( how the OS works with files )
sundar156 wrote:
but system wide hooks should be done using c++.Am i right?
Probably.
sundar156 wrote:
Anyway if this is not the right forum please tell where to post?
The Visual C++ forum
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
sundar156 wrote:
In some they say it is only possible in Linux!
That is possible, because you're talking about something OS specific ( how the OS works with files )
sundar156 wrote:
but system wide hooks should be done using c++.Am i right?
Probably.
sundar156 wrote:
Anyway if this is not the right forum please tell where to post?
The Visual C++ forum
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog