Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. how to prevent a file from being opened?

how to prevent a file from being opened?

Scheduled Pinned Locked Moved Managed C++/CLI
sysadmintutorialquestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sundar156
    wrote on last edited by
    #1

    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

    C 1 Reply Last reply
    0
    • S sundar156

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • C Christian Graus

        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

        S Offline
        S Offline
        sundar156
        wrote on last edited by
        #3

        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

        J C 2 Replies Last reply
        0
        • S sundar156

          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

          J Offline
          J Offline
          Jun Du
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • S sundar156

            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

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            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

            S 1 Reply Last reply
            0
            • C Christian Graus

              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

              S Offline
              S Offline
              sundar156
              wrote on last edited by
              #6

              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

              C 1 Reply Last reply
              0
              • S sundar156

                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

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                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

                S 1 Reply Last reply
                0
                • C Christian Graus

                  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

                  S Offline
                  S Offline
                  sundar156
                  wrote on last edited by
                  #8

                  Thank you Christian.I will try in Vc++ forum.

                  Luck is Opportunity with hardwork

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups