how can i check to see if there is a copy of windows media player running and then receive a message when it is done playing a file?
Printable View
how can i check to see if there is a copy of windows media player running and then receive a message when it is done playing a file?
Well the first one is easy. Just check the registry for this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer
The second one, Im not so sure about Im afraid.
[edit] Hold on, I thought you wanted to check for an instalation directory. I have the api you need hold on...[/edit]
That should do you.VB Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Const SW_SHOWNORMAL = 1 Private Sub Command1_Click() Dim WinWnd As Long WinWnd = FindWindow(vbNullString, "Calculator") 'Put window captio here If WinWnd > 0 Then 'This means it is running ShowWindow WinWnd, SW_SHOWNORMAL 'Give it focus End If End Sub
:)