Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.05.21;
Скачать: CL | DM;

Вниз

Флешка   Найти похожие ветки 

 
Keks ©   (2006-05-06 19:27) [0]

Как определить что к компьютера была подключена флешка


 
AlexWlad ©   (2006-05-06 19:30) [1]


const DBT_DEVICEARRIVAL = $8000;
const DBT_DEVICEQUERYREMOVE = $8001;
const DBT_DEVICEQUERYREMOVEFAILED = $8002;
const DBT_DEVICEREMOVEPENDING = $8003;
const DBT_DEVICEREMOVECOMPLETE = $8004;
const DBT_DEVICETYPESPECIFIC = $8005;
const DBT_CONFIGCHANGED = $0018;

procedure TForm1.WMDeviceChange(var Message: TMessage);
          var
            s : string;
          begin
          {Do Something here}
            case Message.wParam of
              DBT_DEVICEARRIVAL :
                s := "A device has been inserted and is now available";
              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 :
                s := "Device has been removed";
              DBT_DEVICETYPESPECIFIC :
                s := "Device-specific event";
              DBT_CONFIGCHANGED :
                s:= "Current configuration has changed"
              else s := "Unknown Device Message";
            end;
            ShowMessage(s);
            inherited;
          end;

type
             TForm1 = class(TForm)
               Button1: TButton;
             private
               { Private declarations }
               procedure WMDeviceChange(var Message: TMessage);
                 message WM_DEVICECHANGE;
             public
               { Public declarations }
             end;


(C) не мой, тут ранее пробегало...


 
Keks ©   (2006-05-06 20:03) [2]

А можно ли получить инфу о подключенной флешке например её название


 
Marser ©   (2006-05-06 20:37) [3]

Дальше смотрим в сторону GetDriveType, GetLogicalDrives, GetVolumeInformation



Страницы: 1 вся ветка

Текущий архив: 2006.05.21;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.028 c
3-1143087512
АндрейК
2006-03-23 07:18
2006.05.21
SQLServer 2000 на win2000Server и win2003Server


9-1130349956
Chuvak
2005-10-26 22:05
2006.05.21
Кодинг игр под Linux на Delphi(Kylix). Реально?


8-1134806433
Kot Andrei
2005-12-17 11:00
2006.05.21
"Упрощение" цветов на фотографии


3-1143202376
sanich
2006-03-24 15:12
2006.05.21
Ошибка: "Capability not supported"


11-1125482226
ECM
2005-08-31 13:57
2006.05.21
KOL+MCK 2.11