Procedure TUSBDeviceNotifier.WMDeviceChange(var amsg: TMessage);
begin
case amsg.WParam of
DBT_DEVICEARRIVAL:
DoDeviceArrival(PDevBroadcastHdr(amsg.LParam));
DBT_DEVICEREMOVECOMPLETE:
DoDeviceRemoveComplete(PDevBroadcastHdr(amsg.LParam));
end;
end;
To obtain more specific information, you can do a typecastDEV_BROADCAST_HDR structure to another structureaccording to type of device type that you monitor. Since we useDBT_DEVTYP_DEVICEINTERFACE, then we can typecast thelParam DEV_BROADCAST_DEVICEINTERFACE.
All About Pascal Delphi And Applied
Popular Posts
-
First, most people suffering from diseases caused by infection, but now, a disease that affects many communities are generally caused by li...
-
For users of smartphones and select road trip, one that so concern perhaps is the resistance of the battery. Yes, the smartphone is pretty ...
Monday, January 2, 2012
Processing WM_DEVICECHANGE
Each time a USB device configuration changes, the window which you registered will receive a message on message queue WM_DEVICECHANGE. Where wParam will be filled with the types of events and lParam contains a pointer to a data structure DEV_BROADCAST_HDR. The following code is an example of how to handle this message.
Subscribe to:
Comments (Atom)