Consider Two Window Exploers that same folder viewing Now.. If a file was delete by One Window Exploers, Then Other Window Exploers Display The Result in a same time. How Can ListView Control can display the result, that one file was deleted by The Other Window Exploer.. It's What I want Understand..
Posted on 2001-03-21 09:12:00 by takion1
takion, Actually, it's a bit easier than you thought. Each time a file is deleted, renamed, moved, copied, or created, the Shell will post a message. In the case of moving, you'll see two message, a delete and a create. In the case of renaming, the same thing (I think)... these are basic messages. There's a second way, where you can insert a VxD and watch what files are accessed and whatever, but that's not what you're asking. To solve the problem you're asking about, the particular API is SHChangeNotify... then there are several messages which will notify you of what just happened. Look for, SHChangeNotifyRegister, SHChangeNotifyDeregister, SHChangeNotify... then just look for the appropriate message. As for using it with the listview, you'll have to program you're own code. Doing it this way, is much easier than writing a VxD. There is one called FileMon with source from SysInternals, but that is a much much more complicated route that goes well beyond what you're looking for. If you just use the ShellNotify API's, you'll be okay. I've done this before (in VB) and it works remarkably well. You can even watch your network shares and stuff like that. Thanks, _Shawn Update: Oh, I forgot, if you view the exports of Shell32.dll, you'll notice an extreme amount of unidentified exports... some documented, others not, SHChangeNotifyRegister (Ordinal 2 -- undocumented) and SHChangeNotifyDeregister (Ordinal 4 -- udocumented) won't be found anywhere in the MSDN archives... you'll find them on the Windows95 undocumented website... Windows95 Undocumented Have fun This message was edited by Shawn Bullock, on 3/21/2001 11:08:29 AM
Posted on 2001-03-21 09:48:00 by _Shawn
thank you,_Shawn.. It is Great help to me..
Posted on 2001-03-26 00:23:00 by takion1