Autor Beitrag
PheliX
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 59



BeitragVerfasst: Di 17.06.03 17:39 
Hey Leutz!

Wie stell ich fest, ob eine CD in ein beliebiges Laufwerk gelget wurde?

(irgendwie muss es ja gehn, sonst würd ja dieses ganze Autostart geraffel nit funtzen)

Schon mal Danke
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Di 17.06.03 19:34 
Hi!

Stichwort: WM_DEVICECHANGE + Google

oder

www.swissdelphicente.../showcode.php?id=372
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Mi 18.06.03 11:22 
Titel: CD-Wechsel
:cool:

Audio-CDfach öffnen:
mciSendString('Set cdaudio door open wait', nil, 0, handle);
Audio-CDfach schließen:
mciSendString('Set cdaudio door closed wait', nil, 0, handle);
Du musst die Unit "mmsystem" einbinden!!!


Auf Wechsel reagieren:

private
procedure WMDeviceChange(var Msg: TMessage);
message WM_DEVICECHANGE;

Implementation der Procedure:

procedure TForm1.WMDeviceChange (var Msg: TMessage);
const
CD_IN = $8000;
CD_OUT = $8004;
begin
inherited;
case Msg.wParam of
CD_IN : Showmessage('CD ist im Laufwerk');
CD_OUT : Showmessage('CD ist nicht im Laufwerk');
end;
end;


beides gefunden im Easy Delphi Helper 2000 auf:
www.delphi-treff.de/