怎么用delphi实现卸载usb设备(150分)

  • 主题发起人 主题发起人 hanpengshan_00
  • 开始时间 开始时间
H

hanpengshan_00

Unregistered / Unconfirmed
GUEST, unregistred user!
不需要在状态栏里用鼠标右键单击停止设备,然后连续弹出几个窗口后终于把usb设备卸载了,然后可以安全拔下来,烦
 
看一下这个是不是你要的..

http://www.yeahware.com/download/eject.zip
 
http://www.safelyremove.com/safelyremovesetup.exe
这个也可以,
 
这个API函数:

The EjectDiskFromSADrive function ejects the media that is in a standalone removable drive.

DWORD WINAPI EjectDiskFromSADrive(
LPCWSTR lpComputerName,
LPCWSTR lpAppName,
LPCWSTR lpDeviceName,
HWND hWnd,
LPCWSTR lpTitle,
LPCWSTR lpMessage,
DWORD dwOptions
);

Parameters
lpComputerName
[in] Removable Storage Manager (RSM) server name. If this parameter is NULL, the current computer name is used.
lpAppName
[in] Unique character string that identifies the application. This name identifies resources and operator requests. This parameter is optional and may be NULL.
lpDeviceName
[in] Name of the device to eject. For example, //./Cdrom0 or //./PhysicalDriveX (where X is the number of the drive being accessed).
hWnd
[in] Handle to a dialog box window for user confirmation.
lpTitle
[in] Title displayed in a dialog box to get user input.
lpMessage
[in] Message displayed in a dialog box to get user input.
dwOptions
[in] Action to perform. This parameter can be one of the following values.
 
可以吗?试试
 
to: Neo_leaf
怎么给我的这个api在delphi查不到?
safelyremover是工具,没有源码啊
 
后退
顶部