CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2010
    Posts
    2

    How can I use API to detect registry or file changes, file opening, or app execution?

    Hi guys!


    I am trying to write my own code to monitor and detect any registry or file changes. I would also like to detect when a file is being open or when an application is going to be executed.

    I am using VB language.

    Can anyone give me a hand here?


    Regards,

    Frank

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Talking Re: How can I use API to detect registry or file changes, file opening, or app execut

    Well, you could use the RegNotifyChangeKeyValue API, obviously you'll need RegOpenKey and RegCloseKey APIs as well. This si the only way I know. The one drawback to using this, is that you'll have to do this for all Registry keys and subkeys, so you may want to loop through all the main registry keys, and take it from there.

    In this sample ( I found ) the Form load event is used - you might want to consider using a Timer here...

    I hope it helps.

    Hannes
    Attached Files Attached Files

  3. #3
    Join Date
    Apr 2009
    Posts
    394

    Re: How can I use API to detect registry or file changes, file opening, or app execut

    for files, you can get most of what you want from ReadDirectoryChangesW API...



    Good Luck

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured