Работа с USB на DELPHI
Работа с USB на DELPHI
Работа с USB на DELPHI procedure tmain.wmdevicechange(var message: tmessage); var s : string; begin {do something here} case message.wparam of dbt_devicearrival : showessage('ok'); dbt_devicequeryremove: begin s := 'permission to remove a device is requested'; showmessage(s); {true grants premission} message.result := integer(true); exit; end; dbt_devicequeryremovefailed : s := 'request to remove a device has been canceled'; dbt_deviceremovepending : s := 'device is about to be removed'; dbt_deviceremovecomplete : showmessage('del'); dbt_devicetypespecific : s := 'device-specific event'; dbt_configchanged : s:= 'current configuration has changed' else s := 'unknown device message'; end; if s <> '' then showmessage(s); inherited; end;