Ver Mensaje Individual
  #3  
Antiguo 06-04-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Tal como está no funciona y no sé para un adaptador de cámaras pero acabo de probar con una memoria usb y funciona con el siguiente cambio en la unidad CdChange:

Código Delphi [-]
procedure TCdChange.WndProc(var Msg: TMessage);
var
  Drive: Char;

begin
  if Msg.Msg = WM_DEVICECHANGE then
    with TWMDeviceChange(Msg) do
      if
        ((Event = DBT_DEVICEARRIVAL) or (Event = DBT_DEVICEREMOVECOMPLETE)) and
        (Header.DeviceType = DBT_DEVTYP_VOLUME) {and
        (PDevBroadcastVolume(Header).Flags and DBTF_MEDIA <> 0)}
      then
      begin
        Drive := GetDriveFromMask(PDevBroadcastVolume(Header).UnitMask);

        case Event of
          DBT_DEVICEARRIVAL:
            if Assigned(FOnCdInserted) then FOnCdInserted(Self, Drive);

          DBT_DEVICEREMOVECOMPLETE:
            if Assigned(FOnCdRemoved) then FOnCdRemoved(Self, Drive);
        end;
      end;
end;

es dicer, omitiendo la verificación de PDevBroadcastVolume(Header).Flags.

// Saludos
Responder Con Cita