Cd romm wysowanie cd

0

mam powyrzszy kod ale mi nie dziala chociaz wielu zeczy probowalem
moze mi ktos napisac jak zmienne zadeklarowac ( w tym porzykladzie) i jak top do buttona dodac bo już mnie zalamka bieze

uses MMSystem;

procedure OpenCloseCD(Drive: String; OpenCD: Boolean);
var
OpenParm: TMCI_Open_Parms;
begin
OpenParm.dwCallback := 0;
OpenParm.lpstrDeviceType := 'CDAudio';
OpenParm.lpstrElementName := PChar(Drive); {Drive musi byc w formacie "X:"}
if OpenCD then
begin{Otwieranie szuflady}
mciSendCommand(0, MCI_OPEN, MCI_OPEN_ELEMENT or MCI_OPEN_TYPE, Longint(@OpenParm));
mciSendCommand(OpenParm.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
end
else
begin {zamykanie szuflady}
mciSendCommand(0, MCI_OPEN, MCI_OPEN_ELEMENT or MCI_OPEN_TYPE, Longint(@OpenParm));
mciSendCommand(OpenParm.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0);
end; {zamykanie MCI, bez tego kolejna proba otwarcia/zamkniecia szuflady zakonczylaby sie niepowodzeniem!!! }
mciSendCommand(OpenParm.wDeviceID, MCI_CLOSE, MCI_NOTIFY, Longint(@OpenParm));
OpenCD := not OpenCD;
end;

---= pozdrawiam Oskar =- (delphi 6 GG:2792614)

0

do uses dodaj mmsystem;

mciSendString('Set cdaudio door open wait',nil,0,handle); * wysunięcie
mciSendString('Set cdaudio door closed wait',nil,0,handle); * wsunięcie

[email protected] pozdrawia !!!!!!!

0

dodałem oto caly kod co jest nie tak w nim ze nie chce mi cdroom wysowac

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs ,MMSystem, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }

  procedure OpenCloseCD(Drive: String; OpenCD: Boolean);

public
{ Public declarations }

end;

var
Form1: TForm1;
procedure OpenCloseCD(Drive: String; OpenCD: Boolean);
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
OpenParm: TMCI_Open_Parms;
I:string;
Drive: String;
OpenCD: Boolean;
begin
OpenParm.dwCallback := 0;
OpenParm.lpstrDeviceType := 'CDAudio';
OpenParm.lpstrElementName := PChar(I); {Drive musi byc w formacie "X:"}
if OpenCD then
begin{Otwieranie szuflady}
mciSendCommand(0, MCI_OPEN, MCI_OPEN_ELEMENT or MCI_OPEN_TYPE, Longint(@OpenParm));
mciSendCommand(OpenParm.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
end
else
begin {zamykanie szuflady}
mciSendCommand(0, MCI_OPEN, MCI_OPEN_ELEMENT or MCI_OPEN_TYPE, Longint(@OpenParm));
mciSendCommand(OpenParm.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0);
end; {zamykanie MCI, bez tego kolejna proba otwarcia/zamkniecia szuflady zakonczylaby sie niepowodzeniem!!! }
mciSendCommand(OpenParm.wDeviceID, MCI_CLOSE, MCI_NOTIFY, Longint(@OpenParm));
OpenCD := not OpenCD;
end;

end.
---= pozdrawiam Oskar =- (delphi 6 GG:2792614)

1 użytkowników online, w tym zalogowanych: 0, gości: 1