Johanns Sani-GREGORIAN

No Code
  • rss
  • Home
  • About
  • Gallery
  • Projects
  • Music

.NET: Receive disk / media notifications from Windows Shell

admin | July 17, 2007

ShellMediaChangeNotifier: 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

Categories
development
Tags
.net, c#, c++/cli
Comments rss
Comments rss
Trackback
Trackback

« GeSHi C++ and Windows Data Types “died in a computing accident” »

One response

How do you create to instances of dynamips on Windows

Randhir Chawda | November 27, 2007

How 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

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

 

July 2007
M T W T F S S
« Jun   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

  • development
  • howto
  • misc
  • networking
  • shoretel

Tags

.net c# c++/cli cisco cpp emulator geshi ios shoreware director shoretel installation vista windows profile cache domain account howto windows remote install

Blogroll

  • Howard Scholz
  • Will Sani

Company

  • Gearworx LLC
  • Veritix

Links

  • LinkedIn Profile
  • Register

Spam Blocked

1,569 spam comments
blocked by
Akismet
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox