Results 1 to 3 of 3

Thread: Music

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    8

    Music

    Hey, what's the code to have music repeating in the background? You know, like in games. And I still need help in my "Option Box" question.
    ~The Firemage

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Posts
    8

    i may wish to point out

    there are multiple people on 1 IP adress using this account. Thats why theres so many questions from me
    ~The Firemage

  3. #3
    Member
    Join Date
    Nov 2001
    Location
    Heaven........ Whats that fire doing here?
    Posts
    39

    Talking Hey man this is what I use......... For everything when I want sound or Back Music

    'SoundPlayWorks


    'Modual

    Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
    Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    ' flag values for uFlags parameter
    Public Const SND_SYNC = &H0 ' play synchronously (default)
    Public Const SND_ASYNC = &H1 ' play asynchronously
    Public Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
    Public Const SND_NODEFAULT = &H2 ' silence not default, if sound not found

    Public Const SRCCOPY = &HCC0020 ' (DWORD) dest = source
    Public Const SRCPAINT = &HEE0086 ' (DWORD) dest = source OR dest
    Public Const SRCAND = &H8800C6 ' (DWORD) dest = source AND dest
    Public Const SRCINVERT = &H660046 ' (DWORD) dest = source XOR dest
    Public Const SRCERASE = &H440328




    'Code''''''''''''''''''''''''''''''''''''''''''''''''''


    Private Sub Form_Load()
    j = sndPlaySound(App.Path + "\Needle.wav", SND_ASYNC Or SND_LOOP)'Makes the music loop, delete the Or SND_LOOP if you do not want the music to keep on playing
    End Sub


    'I would also add this code into the form terminate and stuff like that because if you dont and the program quits on accident, it will keep on playing the music... heh
    Private Sub Form_Unload(Cancel As Integer)
    j = sndPlaySound(vbNullString, SND_ASYNC)
    End Sub



    'YOU MIGHT HAVE TO ADJUSTS SOME THINGS TO FIT ON ONE LINE
    []:::::::::::[];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;/

    Did you know that you can be your own grandpa?! It's really cool. . . . . .
    ------------------------------------------------
    But I'm not. . . Im just Myself. . . . .
    Not my own grandpa. . . . . .

    I put on my own pants today. . . . .
    Im so proud of myself. . . . .

Posting Permissions

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



Click Here to Expand Forum to Full Width