So let's begin;;;;;;;;;
First make a form with simply 2 commands one called Open CD and the other called Close CD "I can't put imagesright now because I have only 6 posts":(
The code should be:
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
Public retValue As Long
Private Sub Command1_Click()
retValue = mciSendString("Set CDAudio door open", 0, 0, 0)
End Sub
Private Sub Command2_Click()
retValue = mciSendString("Set CDAudio door Closed", 0, 0, 0)
End Sub
well this is the explanation:First I declared a function "An API function" called mciSendString >>> If u don't know what is API plz get out of the topic :) I'm joking ;
well API stands for Application Programming Interface and they are a group of compiled functions in a special type of files called dll files so u can include them to perform certain functions so in my example the function is mciSendString and the dll file which contains the function is winmm.dll and i included the function in my program by using the word Declare Function
I think that u got the idea of API if u need more explanation about API dont't hesitate just tell me :)
now to the second part of the code which is
Public retValue As Longwell i made a variable of the type "Long" to receive the output of the API function and i made it public so that all subroutines will be able to recognize it....
retValue = mciSendString("Set CDAudio door open", 0, 0, 0)
In this line of code I entered parameters to the API function and then received the output which will be long value in the variable retValueretValue = mciSendString("Set CDAudio door Closed", 0, 0, 0)
the same as before but i changed the first parameter so that i can close the CD......I hope u enjoyed the lesson.....
this is me Zizooooo
Good bye


Sign In
Create Account


Back to top









