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
1 Attachment(s)
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
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