News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

custom message on deletion of file...

Started by shakuni, May 15, 2008, 03:04:09 PM

Previous topic - Next topic

shakuni

While deleting some files on windows XP, I get this message
"Deleting this File Will Make some Programs not Work"
I want to know weather 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).

white scorpion

If you put the file attribute 'system' (S) on a file, Windows will give you a similar message.

you can add it to a file (test.exe) through the command prompt like this:


c:\>attrib +s test.exe


Or you can use the Windows API SetFileAttributes.


I'm not sure about creating a custom message though.
It's probably a string in one of the system DLL's. So theoretically you could alter the string in the DLL but I wouldn't recommend it since it's part of the system and might get updated automatically through Windows Updates.