Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennykerr/fe31d32c150aa2457ed5 to your computer and use it in GitHub Desktop.
Save kennykerr/fe31d32c150aa2457ed5 to your computer and use it in GitHub Desktop.
#include "pch.h"
#include <conio.h>
using namespace Modern;
using namespace Windows::Devices::Enumeration;
int main()
{
Initialize();
DeviceWatcher watcher = DeviceInformation::CreateWatcher();
watcher.Added([](DeviceWatcher const &, DeviceInformation const & info)
{
printf("%ls\n", info.Name().Buffer());
});
watcher.EnumerationCompleted([](DeviceWatcher const &, auto const &)
{
printf("Done!\n");
});
watcher.Start();
_getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment