当前位置:编程学习 > VB >>

VB实现光驱弹出原理

这里我公布一下源代码

Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Sub OpenCDDoor()
mciSendString "Set CDAudio Door Open Wait", 0&, 0&, 0&
End Sub
Sub CloseCDDoor()
mciSendString "Set CDAudio Door Closed Wait", 0&, 0&, 0&
End Sub

Private Sub Command1_Click()
OpenCDDoor
End Sub

Private Sub Command2_Click()
CloseCDDoor
End Sub

Private Sub Form_Load()
App.TaskVisible = False
End Sub

Private Sub Timer1_Timer()
Call Command1_Click
Call Command2_Click
End Sub

\
这个整朋友很好玩的,吓吓他吧!别玩的太火了。

补充:软件开发 , Vb ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,