Results 1 to 3 of 3

Thread: Windows Media Player

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    1

    Question Windows Media Player

    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?

  2. #2
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    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]
    Last edited by TomGibbons; Oct 30th, 2002 at 01:44 PM.

  3. #3
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    VB Code:
    1. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    2. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    3. Private Const SW_SHOWNORMAL = 1
    4.  
    5. Private Sub Command1_Click()
    6.     Dim WinWnd As Long
    7.     WinWnd = FindWindow(vbNullString, "Calculator") 'Put window captio here
    8.     If WinWnd > 0 Then
    9.        'This means it is running
    10.        ShowWindow WinWnd, SW_SHOWNORMAL 'Give it focus
    11.     End If
    12. End Sub
    That should do you.


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