怎样在系统中检测到USB flash disk,并获得它的根目录(盘符)????
解决方案 »
- SendMessage的简单问题!!!
- 一个比较弱智的容器类问题
- 拜师学艺,1000元人民币的学费
- 低能儿提问
- 我用ADO+ORACLE开发的activeX网页,客户端总是提示我要安装ORACLE呢?必须安装吗?
- 如何将声音文件存入数据库的blob字端
- 过来人帮我指点一下吧,我改何去何从?非常感谢
- 你们好,大家玩过网络游戏传奇吗?玩过的一定知道它有一个文件叫mir.dat,我用edit打开它发现里面有很多delphi的语句,不知可否把这个文件译
- 编程读取操作系统当前在线的用户列表
- 难道真的没有好办法用delphi取得本机硬盘序列号码(Win2000)? 在线..........
- 请问谁有聊天室程序的源码,谢谢.
- 如何动态创建一个子窗体?(在DELPHI7中)
begin
if not (DriveNum in DriveBits) then Continue;
DriveChar := Char(DriveNum + Ord('a'));
DriveType := TDriveType(GetDriveType(PChar(DriveChar + ':\')));
if TextCase = tcUpperCase then
DriveChar := Upcase(DriveChar); case DriveType of
dtFloppy: Items.AddObject(DriveChar + ':', FloppyBMP);
dtFixed: AddDrive(VolumeID(DriveChar), FixedBMP);
dtNetwork: AddDrive(NetworkVolume(DriveChar), NetworkBMP);
dtCDROM: AddDrive(VolumeID(DriveChar), CDROMBMP);
dtRAM: AddDrive(VolumeID(DriveChar), RAMBMP);
end;
end;
);Value Meaning
0 The drive type cannot be determined.
1 The root directory does not exist.
DRIVE_REMOVABLE The drive can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.//sample:可以用消息,给你贴一段zswang兄的://思路是监测驱动器的改变~~
//插来插去,测试了一下,得到的数值~~type
TForm1 = class(TForm)
Memo1: TMemo;
private
{ Private declarations }
procedure WMDEVICECHANGE(var Msg: TMessage); message WM_DEVICECHANGE; //驱动器改变
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WMDEVICECHANGE(var Msg: TMessage);
begin
inherited;
case Msg.WParam of
32772: Caption := '关闭';
32768: Caption := '就绪';
end;
end;