منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : فتح واغلاق محرك الأقراص
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : AhmedEssawy


كود :
Imports System.Runtime.InteropServices
Imports System.Text
...

Public Shared Sub Main()
Dim result As Integer = mciSendString("set cdaudio door open", Nothing, 0, IntPtr.Zero)
result = mciSendString("set cdaudio door closed", Nothing, 0, IntPtr.Zero)
End Sub

Protected Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal mciCommand As String, ByVal returnValue As StringBuilder, ByVal returnLength As Integer, ByVal callback As IntPtr) As Integer