Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Go Back  Xtreme Visual Basic Talk > > > Playing a playlist but can't minimise the media player


Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2015, 09:43 AM
evanscolin evanscolin is offline
Junior Contributor
 
Join Date: Jan 2004
Posts: 200
Default Playing a playlist but can't minimise the media player


Hi

I can play the selected playlist using the following code but wondered if there was a way of minimising the windows media player in the same code

Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Dim ret As Long


Private Sub cmd1_Click()
lblPlaying.Caption = cmd1.Caption
ret = ShellExecute(Me.hWnd, vbNullString, "C:\ditl\music\playlist1.m3u", vbNullString, CurDir, 1)
End Sub

Cheers

Colin
Reply With Quote
  #2  
Old 06-07-2015, 01:50 PM
passel's Avatar
passelPlaying a playlist but can't minimise the media player passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

The last parameter you're sending in your shellExecute call says how to show the window, in your case you're sending 1, which is SW_SHOWNORMAL.

If you want it minimized, try sending SW_SHOWMINIMIZED, which is 2.

https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
Some other constants are listed at the link above.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
 
Playing a playlist but can't minimise the media player
Playing a playlist but can't minimise the media player
 
-->