2020-07-15 11:10:20 +00:00
|
|
|
#pragma once
|
|
|
|
#include "wtl.h"
|
|
|
|
|
|
|
|
typedef CWinTraits<WS_OVERLAPPED, WS_EX_APPWINDOW> DeviceNotificationTraits;
|
|
|
|
|
|
|
|
class DeviceNotification :
|
|
|
|
public CWindowImpl<DeviceNotification, CWindow, DeviceNotificationTraits>
|
|
|
|
{
|
|
|
|
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);
|
2021-03-27 05:35:51 +00:00
|
|
|
};
|