Visualizzazione dei risultati da 1 a 5 su 5

Discussione: help: avviso sonoro

  1. #1

    help: avviso sonoro

    Ciao, qualcuno sa dirmi come posso in VB far generare in un determinato momento o evento un richiamo sonoro tipo sveglia o cosa simile! Ciao grazie
    ps. ai primi che rispondono 60000000 Euro:gren:

  2. #2
    Utente di HTML.it L'avatar di Markooo
    Registrato dal
    Mar 2003
    Messaggi
    247
    Copia - incolla nel form questo:

    codice:
    Private Const SND_APPLICATION = &H80         '  look for application specific association
    Private Const SND_ALIAS = &H10000     '  name is a WIN.INI [sounds] entry
    Private Const SND_ALIAS_ID = &H110000    '  name is a WIN.INI [sounds] entry identifier
    Private Const SND_ASYNC = &H1         '  play asynchronously
    Private Const SND_FILENAME = &H20000     '  name is a file name
    Private Const SND_LOOP = &H8         '  loop the sound until next sndPlaySound
    Private Const SND_MEMORY = &H4         '  lpszSoundName points to a memory file
    Private Const SND_NODEFAULT = &H2         '  silence not default, if sound not found
    Private Const SND_NOSTOP = &H10        '  don't stop any currently playing sound
    Private Const SND_NOWAIT = &H2000      '  don't wait if the driver is busy
    Private Const SND_PURGE = &H40               '  purge non-static events for task
    Private Const SND_RESOURCE = &H40004     '  name is a resource name or atom
    Private Const SND_SYNC = &H0         '  play synchronously (default)
    Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
    Ora puoi eseguire un qualsiasi file .wav in questo modo (per esempio cliccando su un command button):

    codice:
    Private Sub Command1_Click()
       PlaySound "metti qui il percorso del file.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
    End Sub
    Grazie, attendo i 60000000 € :gren:
    Non saprei

  3. #3
    Ok grazie mille....i soldi te li mandero per email! :gren:
    posso kiederti un altra cosa???!! mi è venuto un grossissimo dubbio in merito ai file random...mi diresti cosa c'e di sbagliato in questo codice??? spero tu possa risp subito:

    Private Type rec
    primo As String
    sec As String
    End Type
    Dim pr As rec

    Private Sub Command1_Click()

    Open "c:\p.txt" For Random As #1 Len = Len(pr)
    pr.primo = Text1.Text
    pr.sec = Text2.Text
    n = Seek(1)
    Put #1, n, pr
    Close #1
    End Sub

  4. #4
    no scusami non era quello l'esempio....ma questo:

    Private Type rec
    primo As String * 20
    sec As String * 20
    End Type
    Dim pr As rec

    Private Sub Command1_Click()

    Open "c:\pp.txt" For Random As #1 Len = Len(pr)
    pr.primo = Text1.Text
    pr.sec = Text2.Text
    numerorecord = Seek(1)
    Put #1, numerorecord, pr
    Close #1
    End Sub


    PERCHE OGNI OSCRITTURA VIENE POI SOVRASCRITTA???

  5. #5
    probabilmente perche' dai lo stesso numero di record...

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.