#pragma once #include "wtl.h" typedef CWinTraits DeviceNotificationTraits; class DeviceNotification : public CWindowImpl { public: DECLARE_WND_CLASS(_T("My Window Class")) BEGIN_MSG_MAP(DeviceNotification) MSG_WM_CREATE(OnCreate) MSG_WM_DEVICECHANGE(OnDeviceChange) END_MSG_MAP() DeviceNotification(); ~DeviceNotification(); private: int OnCreate(LPCREATESTRUCT lpCreateStruct); BOOL OnDeviceChange(UINT nEventType, DWORD dwData); };