+ Reply to Thread
Results 1 to 5 of 5

Thread: Control ur CD without a touch

  1. #1
    Zizooooo is offline Newbie
    Join Date
    Jul 2009
    Posts
    14
    Rep Power
    0

    Arrow Control ur CD without a touch

    Hiiii, I'm going explain a simple program which will enable u to control ur CD ; I mean "Opening and Closing ur CD" without a touch. you'll do this from your VB program.
    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:
    Code:
    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
    Code:
    Public retValue As Long
    well 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....
    Code:
    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 retValue
    Code:
    retValue = 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

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Control ur CD without a touch

    interesting tutorial. Thanks +rep!

  4. #3
    Zizooooo is offline Newbie
    Join Date
    Jul 2009
    Posts
    14
    Rep Power
    0

    Re: Control ur CD without a touch

    Thanks for reply >>>>>

  5. #4
    sk8rjess's Avatar
    sk8rjess is offline Newbie
    Join Date
    Aug 2009
    Location
    Norhtern, KY
    Posts
    4
    Rep Power
    0

    Re: Control ur CD without a touch

    works great.
    thanks for the tut!

  6. #5
    Join Date
    Apr 2009
    Location
    Uppsala, Sweden
    Posts
    9,547
    Blog Entries
    5
    Rep Power
    98

    Re: Control ur CD without a touch

    nice work +rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to find a control that was created through a custom control (dll file)
    By ManyTimes in forum ASP, ASP.NET and Coldfusion
    Replies: 0
    Last Post: 05-31-2011, 04:08 PM
  2. Is there are difference between version control and revision control?
    By DarkLordofthePenguins in forum General Programming
    Replies: 4
    Last Post: 02-20-2011, 06:21 PM
  3. Touch Graph
    By xXHalfSliceXx in forum The Lounge
    Replies: 1
    Last Post: 06-08-2009, 04:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts