WM_DEVICECHANGE sets wParam to DBT_DEVNODES_CHANGED to update list (tree?) nodes. No other info is available then. I have not retrieved any device list, so it is useless for me.
To receive DBT_DEVICEARRIVAL it is necessary to first use RegisterDeviceNotification.
At this point no other help is required. Thanks Vaclav
I need some help / hints with implementing WM_DEVICECHANGE in MFC Document /View setup. I have managed to intercept the WM_DEVICECHANGE in CmainFrame message map and process it . The problem m is that the wParam is nowhere near the 0x8xxx, but it is plain “7” and the lParam is 0.
I went thru the Dbt.h and cannot figure out what is the wParam = 7 telling me.
Here is the code snippet and if it is not formatted to you liking – I am sorry , but I write my stuff in OpenOffice and than copy it to CodeProject so it cannot be formatted properly.
<b>I just need some troubleshooting pointer / suggestion how to analyze these mysterious parameters. </b>
Maybe CmainFRame is not the place to start, but I got same parameters values when I used Cdialog message map directly.
Addendum JUst found this info, so the additional question is - is CMainFrame "top window" and if not will RegisterDeviceNotification solve this ? I shall try it next.
The DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events are automatically broadcast to all top-level windows for port devices. Therefore, it is not necessary to call RegisterDeviceNotification for ports, and the function fails if the dbch_devicetype member is DBT_DEVTYP_PORT.
Your code and text can be formatted properly. It must be done manually after pasting (it does not care if pasting from OpenOffice or a plain text editor but you should remove HTML tags when pasting from Ooo). Select text with mouse and use the buttons above the edit window to apply specific formatting. If you know HTML, you may also type the HTML tags. Check the preview to see how it looks.
Thank you, obviously I have not look all the way to the end of the page!
However, what the dickens is " ring3 people" note talking about? So when "new node is detected / chaged" is not same as
DBT_DEVICEARRIVAL A device has been inserted and is now available.
Mr MS - I am not sure this note is in English!
and to get the device more work is necessary??? I am not sure I can figure that out, getting tired of this USB mess.
/* * Message = WM_DEVICECHANGE * wParam = DBT_DEVNODES_CHANGED * lParam = 0 * * send when configmg finished a process tree batch. Some devnodes * may have been added or removed. This is used by ring3 people which * need to be refreshed whenever any devnode changed occur (like * device manager). People specific to certain devices should use * DBT_DEVICE* instead. */ #define DBT_DEVNODES_CHANGED 0x0007