playing mp3-files 
Author Message
 playing mp3-files

Hi.
I have an access97 db in which I can play mp3-files using winamp (2.24)
The following code made by Dew A can stop the mp3-file by stopping winamp in
general.

Q: How can I stop playing the actual mp3-file without stopping winamp?

'************** Code Start ***************
'This code was originally written by Dev Ashish.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Dev Ashish
'
Private Const WM_CLOSE = &H10
Private Const INFINITE = &HFFFFFFFF
Private Declare Function apiPostMessage Lib "user32" _
        Alias "PostMessageA" _
        (ByVal Hwnd As Long, _
        ByVal wMsg As Long, _
        ByVal wParam As Long, _
        lParam As Any) _
        As Long
Private Declare Function apiFindWindow Lib "user32" _
        Alias "FindWindowA" _
        (ByVal lpClassname As String, _
        ByVal lpWindowName As String) _
        As Long
Private Declare Function apiWaitForSingleObject Lib "kernel32" _
        Alias "WaitForSingleObject" _
        (ByVal hHandle As Long, _
        ByVal dwMilliseconds As Long) _
        As Long
Private Declare Function apiIsWindow Lib "user32" _
        Alias "IsWindow" _
        (ByVal Hwnd As Long) _
        As Long

Function fCloseApp(lpClassname As String) As Boolean

Dim lngRet As Long, lnghWnd As Long, lngx As Long
    lnghWnd = apiFindWindow(lpClassname, vbNullString)
    If lnghWnd <> 0 Then
        lngRet = apiPostMessage(lnghWnd, WM_CLOSE, vbNull, vbNull)
        lngx = apiWaitForSingleObject(lnghWnd, INFINITE)
        fCloseApp = Not (apiIsWindow(lnghWnd) = 0)
    End If
End Function
'************* Code End ***************

Anders Zuschlag, Denmark




Thu, 28 Mar 2002 03:00:00 GMT  
 playing mp3-files



Quote:
> Hi.
> I have an access97 db in which I can play mp3-files using winamp (2.24)
> The following code made by Dew A can stop the mp3-file by stopping winamp
in
> general.

> Q: How can I stop playing the actual mp3-file without stopping winamp?

  Haven't got the faintest idea, having never played with WinAmp.  You'll
have to look at WinAmp documentation.  The code I posted is written to
generically find a window (like Excel/Access etc.) and tell it to close
itself.  If WinAmp, like the typical Media Players, opens itself via file
association, then PostMessage won't work here as it'll always close WinAmp.
In order to get more control over this type of functionality, you have to
use Automation or have some sort of documentation of the app (WinAmp)
itself.

 And for what it's worth, my name is spelled "Dev", not "Dew".

 -- Dev



Fri, 29 Mar 2002 03:00:00 GMT  
 playing mp3-files
Hi.
Thanks for the answer Dev! I'm sory about the spelling!
Anders Z.
Dev Ashish skrev i meddelelsen ...
Quote:

> And for what it's worth, my name is spelled "Dev", not "Dew".

> -- Dev



Fri, 29 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to play MP3 file when document opens

2. how to play mp3 files?

3. How to play MP3 file ?

4. Playing mp3 files....

5. Play MP3 files ?

6. How to play mp3 files

7. Play MP3 File

8. Trouble Playing Mp3 files with VB application

9. Playing MP3 Files In WinAmp

10. Play mp3 files

11. playing MP3 files

12. Playing MP3 files

 

 
Powered by phpBB® Forum Software