MSDN上说:
WM_DEVICECHANGEThe WM_DEVICECHANGE device message notifies an application of a change to the hardware configuration of a device or the computer.A window receives this message through its WindowProc function.LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
程序中在框架类中和View类中分别在WindowProc中 if (message == WM_DEVICECHANGE)
{
TRACE("WM_DEVICECHANGE\n");
}
在框架类中能够捕捉到该消息,在视图类中怎么捕捉不到呢?另外用
afx_msg BOOL OnDeviceChange(
UINT nEventType,
DWORD_PTR dwData
);
这种方法也不行。请指点一下,我想在view类中捕捉到该消息。谢谢。
WM_DEVICECHANGEThe WM_DEVICECHANGE device message notifies an application of a change to the hardware configuration of a device or the computer.A window receives this message through its WindowProc function.LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
程序中在框架类中和View类中分别在WindowProc中 if (message == WM_DEVICECHANGE)
{
TRACE("WM_DEVICECHANGE\n");
}
在框架类中能够捕捉到该消息,在视图类中怎么捕捉不到呢?另外用
afx_msg BOOL OnDeviceChange(
UINT nEventType,
DWORD_PTR dwData
);
这种方法也不行。请指点一下,我想在view类中捕捉到该消息。谢谢。
我是是在view类的WindowProc 加了段代码。有问题么
否则WM_DEVICECHANGE 只发给顶层窗口
msdn里面有说明
The DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events are automatically broadcast to all top-level windows for port devices.