Implementing SDKs.

  • Thread starter Thread starter Tomo Ferega
  • Start date Start date
T

Tomo Ferega

I am writing a program which opens or closes CD tray. I know I can do that
using one of the functions in the Multimedio SDK (forgot the eact name) but
I have no idea how to call it from C# code.
Also, any info on how to use DirectX would be greatly appreciated.

- Huitzilopochtli
 
Hi Tom,

You can PInvoke to call Win32 APIs from C# code.
The MSDN documentation contains a good description of PInvoke.

You can use the WinMM APIs mciSendCommand to open and close
the CD tray.
Please take a look at the MCI_SET command message
with the MCI_SET_DOOR_CLOSED and MCI_SET_DOOR_OPEN
command flags.

Regards,
Aravind C
 
Back
Top