Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    [VB6]Inserire suono durante l'esecuzione del form

    Come faccio ad inserire un suono durante l'esecuzione del form?
    Grazie

  2. #2
    Prova con:
    codice:
    Declare Function PlaySound Lib "winmm.dll" (ByVal szSound As Char(), ByVal hMod As IntPtr, ByVal flags As PlaySoundFlags) As Integer
    
    <Flags()> Public Enum PlaySoundFlags
            SND_SYNC = &H0
            SND_ASYNC = &H1
            SND_NODEFAULT = &H2
            SND_MEMORY = &H4
            SND_LOOP = &H8
            SND_NOSTOP = &H10
            SND_NOWAIT = &H2000
            SND_ALIAS = &H10000
            SND_ALIAS_ID = &H110000
            SND_FILENAME = &H20000
            SND_RESOURCE = &H40004
        End Enum
    
    PlaySound(FILE_NAME, IntPtr.Zero, PlaySoundFlags.SND_LOOP)

  3. #3

  4. #4
    Scusami ma con questo codice mi da 4 errori:
    -Declare Function...
    -<Flags()>...
    -Playsound...(che ho pensato di cambiare in a=playsound)
    -File_Name



    code:


    Declare Function PlaySound Lib "winmm.dll" (ByVal szSound As Char(), ByVal hMod As IntPtr, ByVal flags As PlaySoundFlags) As Integer

    <Flags()> Public Enum PlaySoundFlags
    SND_SYNC = &H0
    SND_ASYNC = &H1
    SND_NODEFAULT = &H2
    SND_MEMORY = &H4
    SND_LOOP = &H8
    SND_NOSTOP = &H10
    SND_NOWAIT = &H2000
    SND_ALIAS = &H10000
    SND_ALIAS_ID = &H110000
    SND_FILENAME = &H20000
    SND_RESOURCE = &H40004
    End Enum

    PlaySound(FILE_NAME, IntPtr.Zero, PlaySoundFlags.SND_LOOP)




    Non so proprio come fare!!!!!!
    help me!

  5. #5
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    lomiz, sei capace di usare il file di risorse?
    Se si, o se decidi di usarlo (ti consiglio in tal senso) ti posto il codice per riprodurre un suono caricandolo dal predetto file.
    Fammi sapere.
    LM

  6. #6
    sbaglio o nel file risorse puoi mettere file molto piccoli?!?
    ditemi voi...nn ricordo bene....

  7. #7
    Scusami ma con questo codice mi da 4 errori:
    -Declare Function...
    -<Flags()>...
    -Playsound...(che ho pensato di cambiare in a=playsound)
    -File_Name
    Scusami tu perché il metodo che ti ho postato può essere usato così com'è in Vb.Net, per usarlo in VB6 bisogna fare qualche piccola modifica. Comunque segui questo sito:
    http://www.visual-basic.it/articoli/fddAudio.htm

  8. #8
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    ranza!!!123,
    MSDN NON dà riferimenti in tal senso e poi non credo che si voglia suonare un'intera sinfonia, sich ... VVoVe:
    LM

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.