下面是MciSendCommand函数的参数说明..你参考一下吧. ?IDDevice Device identifier of the MCI device that is to receive the command message. This parameter is not used with the MCI_OPEN command message. ?uMsg Command message. For information about command messages, see Command Messages. ?fdwCommand Flags for the command message. ?dwParam Address of a structure that contains parameters for the command message.
?IDDevice
Device identifier of the MCI device that is to receive the command message. This parameter is not used with the MCI_OPEN command message. ?uMsg
Command message. For information about command messages, see Command Messages. ?fdwCommand
Flags for the command message. ?dwParam
Address of a structure that contains parameters for the command message.
俺正在学习CB尼[email protected]
#include <MMsystem.h> AnsiString OpenString=AnsiString("open G: type CDAudio alias finch wait";
//其中G:表示你的光驱所在的盘符
mciSendString(OpenString.c_str(),NULL, NULL, NULL);留下Mail的我照发代码.
var
o: MCI_OPEN_PARMS;
status: MCI_STATUS_PARMS;
flags: DWord;
szDriveName: array[0..3] of Char;
begin
szDriveName := '?:';
ZeroMemory(@o, SizeOf(MCI_OPEN_PARMS));
szDriveName[0] := cDrive; o.lpstrDeviceType := PChar(MCI_DEVTYPE_CD_AUDIO);
o.lpstrElementName := szDriveName;
flags := MCI_OPEN_TYPE or MCI_OPEN_TYPE_ID or MCI_OPEN_ELEMENT or MCI_OPEN_SHAREABLE;
if mciSendCommand(0, MCI_OPEN, flags, Cardinal(@o)) = 0 then
begin
status.dwItem := MCI_STATUS_READY; if bOpenDrive then
mciSendCommand(o.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0)
else
mciSendCommand(o.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0); mciSendCommand(o.wDeviceID, MCI_CLOSE, MCI_WAIT, 0);
end;
end;
String OpenString='open G: type CDAudio alias finch wait';
//其中G:表示你的光驱所在的盘符
mciSendString(Pchar(OpenString),NULL, NULL, NULL);
你看这就是转换过的Delphi代码
var
OpenString: String = 'open G: type CDAudio alias finch wait';
//其中G:表示你的光驱所在的盘符
mciSendString(Pchar(OpenString),NULL, NULL, NULL);
你看这就是转换过的Delphi代码