//打开光驱 <br>mciSendString('Set cdaudio door open wait', nil, 0, handle); <br>//关闭光驱 <br>mciSendString('Set cdaudio door closed wait', nil, 0, handle) <br><br><br>监视光驱中是否有光盘拦截消息WM_DEVICECHANGE即可!<br>//响应该消息<br>procedure Tform1.WMDEVICECHANGE(var msgx :Tmessage);<br>const<br> DBT_DEVICEARRIVAL=$8000;<br> DBT_DEVICEREMOVECOMPLETE=$8004;<br>begin<br> inherited;<br> case msgx.WParam of<br> DBT_DEVICEARRIVAL:Caption :='有了!';<br> DBT_DEVICEREMOVECOMPLETE:Caption :='取走了';<br> end;<br>end;<br>