这个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.