Interesting API: Win32DeleteFile
on 07.05.06, 07:01am in windows • Comments (0)
Every once in a while when perusing MSDN, I stumble across some API that just seems curious (my favorite is SHGetUnreadMailCount()). Check out Win32DeleteFile:
BOOL Win32DeleteFile(LPCTSTR pszFileName);
Sure it looks pretty straightforward, but I wondered why there a different "Win32" API for deleting a file rather than just using the standard DeleteFile()?
The answer turns out to be pretty simple, actually. After some investigation (and just stepping through with WinDBG), the only difference is that Win32DeleteFile() actually calls SHChangeNotify() for you with the SHCNE_DELETE flag so that the shell can refresh itself.
In fact, it just uses DeleteFile() under the hood.
Interesting or useful? Who knows.



