1 CD Tray ကို VB.NET ႏွင့္ ဖြင့္ၿခင္း ၊ ပိတ္ၿခင္း [Programming] 10th October 2009, 2:23 pm
sHa92
Founder
CD Tray ကို ဖြင့္ခ်င္တယ္ဆုိရင္ေတာ့ က်ေနာ္တုိ႔ဟာပထမဆုံးအေနနဲ႔ Application ရဲ႕ API ကို အရင္ဆုံး သတ္မွတ္ေပးရပါမယ္။
အဲဒီ့လုိ သတ္မွတ္တာကေတာ့ ေအာက္က Code နဲ႔ပါ။
CD Tray ကို ဖြင့္ခ်င္ရင္ေတာ့
အဲဒီ့လုိ သတ္မွတ္တာကေတာ့ ေအာက္က Code နဲ႔ပါ။
- Code:
Declare Function s Lib "winmm.dll" Alias "mciSendStringA" (ByVal mess As String, ByVal retVal As String, ByVal s As Integer, ByVal so As Integer) As Integer
CD Tray ကို ဖြင့္ခ်င္ရင္ေတာ့
- Code:
Dim exits As Boolean = False
Public Function Open() As Integer
Dim ret As String
ret = New String(CChar(" "), 255)
Open = s("Set CDAudio Door Open Wait", ret, 0&, 0&)
End Function
- Code:
Public Function Closes() As Integer
Dim strReturn As String
strReturn = New String(CChar(" "), 255)
Closes = s("Set CDAudio Door Closed Wait", strReturn, 0&, 0&)
End Function