.NET: Receive disk / media notifications from Windows Shell
admin | July 17, 2007ShellMediaChangeNotifier: Provide means of receiving drive addition and removal notifications triggered by Windows Shell (a.k.a: Explorer). This is a not a FileSystemWatcher clone, which raises events on changes made to specific files or directories.
ShellMediaChangeNotifier class is C++/CLI (why waste time with P/Invoke); while the provided demo is in C#.
Download: ShellMediaChangeNotifier and Demo Application
How-to use:
ShellMediaChangeNotifier _s = new ShellMediaChangeNotifier(); // Assign the window handle after it's been created. _s.Handle = this.Handle; _s.Changed += new ShellMediaChangeEventHandler(OnChanged); protected override void WndProc(ref Message m) { ShellMediaChangeNotifier.ProcessWindowsMessages(ref _s, m); base.WndProc(ref m); } void OnChanged(object sender, ShellMediaChangeEventArgs e) { _tbEvents.Text += e.ChangeType.ToString() + " " + e.Path + "\r\n"; }
The provided project file requires Visual Studio 2005 (with Visual C++ and C# installed), and Windows SDK (used Windows 2003 and Vista SDKs). This code has been tested on Windows XP, 2003, and Vista.
Johan






How do you create to instances of dynamips on Windows
Randhir Chawda | November 27, 2007How do you create to instances of dynamips on Windows Vista.I did try changing the dynamip-start.cmd file but it does not read the -H 7201 option and comes back with a “Error unable to connect to localhost:7201″.
Any help would be appreciated