Attention :: How to open or turn off CD-ROM

zhaozj2021-02-11  213

If you want to turn your CD-ROM via VB, you can send a related command request to Windows MultiMedia DLL, but you must first declare the DLL:

Add the following code in the module file:

Declare function mcIndstring lib "winmm.dll" alias _ "mciSendstringa" (byval lpstringa "(byval _lpstrreetstring as string, byval ureturnLENGTH AS long, _

BYVAL HWNDCALLBACK AS Long AS Long

The following is the process code to open the CD-ROM:

RetValue = McIndstring ("Set CDAUDIO DOOR OPEN", _

ReturnString, 127, 0)

Turn off the CD-ROM with the following code:

RetValue = McISendstring ("Set Cdaudio Door Closed", _Returnstring, 127, 0)

转载请注明原文地址:https://www.9cbs.com/read-4047.html

New Post(0)