Results 1 to 6 of 6

Thread: How does one kill this

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    I play a wav file but it seems it has to finish before
    anything can get in
    I want to be able to unload if esc is pressed but
    this function won't let go until it has finished.

    How can I interrupt it and have it quit

    Call sndPlaySound(ByVal App.Path & "\sitting.wav", SND_SYNC)
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136
    Doesn't DoEvents help?
    Visual Basic 6 Enterprise Edition + SP4

  3. #3
    Guest
    Use SND_ASYNC as the flag. For this, you need to declare the const in your module.
    Code:
    Public Const SND_ASYNC = &H1
    Then you would use this to play your WAV.
    Code:
    Call sndPlaySound(ByVal App.Path & "\sitting.wav", SND_SYNC)

  4. #4

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    nope...let me try to explain this in a better way...

    megatron:
    I have the declares in place
    If I do it your way it's the same.
    What I need to do is stop it from playing
    when I hit the esc key.
    If i do it async it just skips through the nag screen
    and flips into the image projector but still finishes
    playing the song.

    I am just trying to bypass the nag screen if esc is pressed.

    I can set the ctlt to a button and have it bypassed on startup like the windows click if you want to see this
    screen on startup but I was trying to just use the esc
    key to do it.

    code in form activate

    Call sndPlaySound(ByVal App.Path & "\sitting.wav", SND_ASYNC)
    Timer1.Enabled = False
    Unload Me
    Load frmPicDisplay
    frmPicDisplay.Show

    'esc key codePrivate Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If (KeyCode = 27) Then
    Unload Me
    End Sub

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Call sndPlaySound with vbNullString for lpszSound to stop the current sound.

  6. #6

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    thank you...

    thanks...
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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