|
-
Nov 10th, 2000, 09:35 AM
#1
Thread Starter
Lively Member
Sheesh..seems I’ve managed to stump the experts here!
What I’m Trying to do in my VB networked program is use ShellExecute to launch the Windows Media Player, and then shut it down from the program.
First the code to LAUNCH:
Dim ItemFile As String
ItemFile = "Training1.mpg"
Call ShellExecute(hwnd, "Open", ItemFile, "", App.Path & "\Items\", 1)
bIsPlaying = True ' SETS THE MULTIMEDIA FLAG!!!
So now I have the Media running; what I WANT to have happen is when the user clicks the “Next Item” button, code in the click event ENDS/CLOSES/KILLS the Windows Media Player!
I’ve looked at the SendMessage, TerminateProcess, and CloseHandle API calls but NONE of them work! Does ANYONE have an idea of how to simply close the MediaPlayer with code from the VB program that will work in Windows 98 AND NT 4.0?? I’d really appreciate any help. Thanks!
-
Nov 10th, 2000, 03:38 PM
#2
Addicted Member
Send Message
Have you tried?
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hwndNewParent As Long) As Long
Private Const WM_CLOSE = &H10
Terminate = SendMessage(hWnd, WM_CLOSE, 0, 0)
It works for me in Win98
Matthew ([email protected])
VB6 Pro
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|