pacabel_
public text v1 · immutablevar
newDrive : TlistItem;
volResult : TVolInfo;
theDrive, theLabel : String;
begin
case wMSG.WParam of
DBT_DEVICEARRIVAL:
if (PDevBroadcast(wMSG.LParam)^.dbch_devicetype = DBT_DEVTYP_VOLUME) then
begin
theDrive := getDrive(PDevBroadcastVolume(wMsg.LParam));
volResult := getVolInfo(theDrive+'\');
newDrive := listview1.Items.add();
newDrive.Caption := 'test';
end;
DBT_DEVICEREMOVECOMPLETE: showMessage('removed');
end;