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