Log in

View Full Version : custom message on deletion of file...


shakuni
May 15th, 2008, 10:56
While deleting some files on windows XP, I get this message
"Deleting this File Will Make some Programs not Work"
I want to know whether I can produce a particular message, like above, when a file gets deleted.

(May be I need to monitor certain files using hook, and when the hook notifies me of their deletion, I show a messagebox like above. But I want to know how "windows" do it).

dELTA
May 15th, 2008, 11:02
I think Windows just says things like that when deleting files of certain types (DLL, OCX, ...?), and/or located at certain locations (c:\Windows, c:\Program Files, ...?).

blurcode
May 15th, 2008, 21:12
He means Windows File Protection (WFP). shakuni if you read http://ntcore.com/Files/wfp.htm from Daniel Pistelli you can understand how it works. It use FindFirstChangeNotification ( http://msdn.microsoft.com/en-us/library/ms889670.aspx ) in it's native form, WFP also use C:\WINDOWS\system32\dllcache\ folder for storing the files under it's protection, so if you delete the file and Windows can find this inside the dllcache folder it restore it else it inform you to insert Windows installation CD-ROM to restore it from there (you can read a bit more at: http://support.microsoft.com/kb/222193 ). You can make a service that do the same for your files.