hooking windows file creations

Posted on 2010-01-02
Medium Priority
Last Modified: 2013-12-03
easy 500 for win32api gurus..
i need to hook/call to know when there is either:
1. a new call to create a file through windows
2. a file is being written to.

In both cases i need to know :
a. the filename
b. if possible, the parent process name (not the handle)

Talk through code for full points.. a delphi sample should be included
Question by:controlr
  • 3
  • 2
LVL 46

Expert Comment

ID: 26166950
This seems like it should be the information you want:

There are also some components that help you do this.

Author Comment

ID: 26176515
unfortunately, the TSCHangeNotify does NOT work on all windows versions.
im looking for PURE API callbacks/hooks
LVL 46

Expert Comment

ID: 26177022
What version of Delphi are you using?
What Windows versions are you targeting?

Author Comment

ID: 26177194
D2010 - must work on   XP,2K3 , Vista,Win7
LVL 46

Accepted Solution

aikimark earned 2000 total points
ID: 26182271
From Peter Below (TeamB) on the Embarcadero Developer Network:
"The ShellApi or ShlObj units are the logical candidates here, I think.
Yup, ShlObj it is, it contains ShChangeNotify."

You might get some development leverage by using a component/wrapper:
Freeware component (with source):

Shareware ($25) component:


Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question