Receiving DBT_DEVICEARRIVAL with DBT_DEVTYP_VOLUME in a service?
Tech-Archive recommends: Fix windows errors by optimizing your registry
User mode question, just hoping for competen audience :-)
In contrast to DBT_DEVTYP_DEVICEINTERFACE with GUID_DEVINTERFACE_VOLUME
DBT_DEVICEARRIVAL with DBT_DEVTYP_VOLUME is sent too if the drive
letter of an existing volume is changed (removed or assingned).
The docs of RegisterDeviceNotification say:
"Volume notifications are also broadcast to top-level windows, so the
function fails if dbch_devicetype is DBT_DEVTYP_VOLUME."
That's true, RegisterDeviceNotification fails with 'The data is invalid'.
So, is there no way to get this message in a service without creating a
window?
Greetings from Germany
Uwe
.
Relevant Pages
- Re: WM_DEVICECHANGE & IOMega ZIP Drive
... Applications send event notifications using the BroadcastSystemMessage function. ... Any application with a top-level window can receive basic notifications by processing the WM_DEVICECHANGE message. ... Applications can use the RegisterDeviceNotification function to register to receive device notifications. ... (microsoft.public.de.vc) - Re: Bluetooth New Radio Revice Notification
... you are registering the devclass GUID, you want to use the device interface ... > I'm doing some Bluetooth programming under Win32. ... > To get notifications about a Bluetooth Radio device I use the following ... > m_hNotify = RegisterDeviceNotification( ... (microsoft.public.win32.programmer.kernel) - Re: Receiving DBT_DEVICEARRIVAL with DBT_DEVTYP_VOLUME in a service?
... you can only specify either DBT_DEVTYPE_DEVICEINTERFACE or DBT_DEVTYPE_HANDLE when you are passing a DEV_BROADCAST_HDR to RegisterDeviceNotification. ... It's my recollection that this worked for me when I needed to receive notifications of volumes being removed or added in a service, but I don't have the source code for that program sitting in front of me. ... "Volume notifications are also broadcast to top-level windows, ... (microsoft.public.win32.programmer.kernel) - Re: FindFirstDevice and C#
... Are you sure that the device supports notifications? ... RegisterDeviceNotification via the "WM_DEVICECHANGE" message. ... I have done this before in C++ under the windows platform, ... supported under the windows ce enviornment. ... (microsoft.public.dotnet.framework.compactframework) - Re: WM_DEVICECHANGE & IOMega ZIP Drive
... Applications send event notifications using the BroadcastSystemMessage function. ... Any application with a top-level window can receive basic notifications by processing the WM_DEVICECHANGE message. ... Applications can use the RegisterDeviceNotification function to register to receive device notifications. ... (microsoft.public.de.vc) |
|