About "SHChangeNotifyRegister"
-
I'd like to ask about "SHChangeNotifyRegister". If anyone knows, please tell me. My PC environment is Windows XP SP1 and VC++ SP5 with including the latest MS SDK files. I read below three articles: http://www.codeproject.com/shell/shchangenotifyregister.asp[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotifyregister.asp[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotify.asp[^] The problem is the event ID "SHCNE_CREATE". For example, creating ".txt" file. When I right-click and select "New" -> "text document"("text file"?) on the desktop, "SHCNE_CREATE" can be caught. However, when I execute "Notepad.exe" and save file on the desktop, "SHCNE_CREATE" can't be caught. I appoint parameters of "SHChangeNotifyRegister" function is below: second parameter:0x0001 | 0x0002 third parameter:SHCNE_ALLEVENTS I'd like to know below two points: (1)Whether the upper problem is the specification? (2)How to catch "SHCNE_CREATE" when creating file from "save file" in menu of application.
-
I'd like to ask about "SHChangeNotifyRegister". If anyone knows, please tell me. My PC environment is Windows XP SP1 and VC++ SP5 with including the latest MS SDK files. I read below three articles: http://www.codeproject.com/shell/shchangenotifyregister.asp[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotifyregister.asp[^] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotify.asp[^] The problem is the event ID "SHCNE_CREATE". For example, creating ".txt" file. When I right-click and select "New" -> "text document"("text file"?) on the desktop, "SHCNE_CREATE" can be caught. However, when I execute "Notepad.exe" and save file on the desktop, "SHCNE_CREATE" can't be caught. I appoint parameters of "SHChangeNotifyRegister" function is below: second parameter:0x0001 | 0x0002 third parameter:SHCNE_ALLEVENTS I'd like to know below two points: (1)Whether the upper problem is the specification? (2)How to catch "SHCNE_CREATE" when creating file from "save file" in menu of application.
Sometimes (actually, a lot of the time...) the application does not properly call the shell notification routines from within itself. It uses lower level IO routines which do not report activity to the shell. You might not be able to catch these types of events. If you REALLY need to monitor for a file or directory change to a specific location, use FindFirstChangeNotification.