Description : We can open and close the tray of the CD drive of the system.
Following are the namespaces
using System.Runtime.InteropServices; using System.Text;
Following is the DLL import part.
[DllImport("winmm.dll", EntryPoint="mciSendStringA", CharSet=CharSet.Ansi)] protected static extern int MymciSendString (string mciCommand, StringBuilder returnValue, int returnLength, IntPtr callback);
Following is the code part to open and close the CD drive
public static void Main( ) { int result = MymciSendString ("open the door ", null, 0, IntPtr.Zero); result = MymciSendString ("close the door", null, 0, IntPtr.Zero); }
By Nathan
|
No responses found. Be the first to respond and make money from revenue sharing program.
|