DeviceController.h
上传用户:hhs829
上传日期:2022-06-17
资源大小:586k
文件大小:2k
- #if !defined(AFX_DEVICECONTROLLER_H__86FFE4DE_3A6C_4EC0_A4FA_FA626FA3CC62__INCLUDED_)
- #define AFX_DEVICECONTROLLER_H__86FFE4DE_3A6C_4EC0_A4FA_FA626FA3CC62__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // DeviceController.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CDeviceController frame
- #if (WINVER < 0x0500)
- #define DBT_DEVTYP_DEVICEINTERFACE 0x00000005 // device interface class
- #define DBT_DEVTYP_HANDLE 0x00000006 // file system handle
- #define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000
- typedef PVOID HDEVNOTIFY;
- #endif
- extern "C"
- {
- typedef BOOL (WINAPI *PUnregisterDeviceNotification)(IN HDEVNOTIFY Handle);
- typedef HDEVNOTIFY (WINAPI *PRegisterDeviceNotification)(IN HANDLE hRecipient,
- IN LPVOID NotificationFilter,
- IN DWORD Flags);
- }
- #if (WINVER < 0x0500)
- typedef struct _DEV_BROADCAST_DEVICEINTERFACE {
- DWORD dbcc_size;
- DWORD dbcc_devicetype;
- DWORD dbcc_reserved;
- GUID dbcc_classguid;
- char dbcc_name[1];
- } DEV_BROADCAST_DEVICEINTERFACE, *PDEV_BROADCAST_DEVICEINTERFACE;
- #endif
- class CDeviceController : public CFrameWnd
- {
- DECLARE_DYNCREATE(CDeviceController)
- protected:
- CDeviceController(); // protected constructor used by dynamic creation
- // Attributes
- public:
- protected:
- HDEVNOTIFY mNotifyHandle;
- PRegisterDeviceNotification mRegisterDeviceNotification;
- PUnregisterDeviceNotification mUnregisterDeviceNotification;
- void Register(void);
- void Unregister(void);
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDeviceController)
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- virtual ~CDeviceController();
- // Generated message map functions
- //{{AFX_MSG(CDeviceController)
- // NOTE - the ClassWizard will add and remove member functions here.
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnClose();
- afx_msg BOOL OnDeviceChange( UINT nEventType, DWORD dwData );
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_DEVICECONTROLLER_H__86FFE4DE_3A6C_4EC0_A4FA_FA626FA3CC62__INCLUDED_)