TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Windows Media

Run WMP with ShellExecute

Windows Media

 
 
Thread Tools Display Modes
Unread 02-11-2007, 08:03 PM   #1
Mark
Guest
 
Posts: n/a
Run WMP with ShellExecute

I manage to run WMP from a command line with a url parameter like
http://10.0.0.1:8080. Trying to do so inside my win32 code with ShellExecute
, using the appropriate parameters, manages to launch the WMP but without
some default target - anyhow not the above url.

Can someone advise how to do that with working code please?

Regards

Mark


 
Unread 02-11-2007, 08:03 PM   #2
Alessandro Angeli
Guest
 
Posts: n/a
Re: Run WMP with ShellExecute

From: "Mark"

> I manage to run WMP from a command line with a url
> parameter like http://10.0.0.1:8080. Trying to do so
> inside my win32 code with ShellExecute , using the
> appropriate parameters, manages to launch the WMP but
> without some default target - anyhow not the above url.
> Can someone advise how to do that with working code
> please?


Would you care to post your working command line and your
non working code or should we guess?




--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


 
Unread 03-11-2007, 11:02 AM   #3
Mark
Guest
 
Posts: n/a
Re: Run WMP with ShellExecute

Thanks and sorry for haven't done so in the first place...
The following code works fine-

ShellExecute(NULL, "open",
"wmplayer.exe","http://10.0.0.11:8080",
"C:\\Program Files\\Windows Media Player\\",
SW_SHOW );
(this works fine also from a dos box).

The following code launches WMP but without the right parameter i.e.
http://10.0.0.11:8080

CString command3 = "http://10.0.0.11:8080";
ShellExecute(NULL, "open",
"wmplayer.exe","command3",
"C:\\Program Files\\Windows Media Player\\",
SW_SHOW );

The difference is only the assignment of-
command3 = "http://10.0.0.11:8080";

Thanks for any help.
Mark

"Alessandro Angeli" <nobody@nowhere.in.the.net> wrote in message
news:O7cyucYHIHA.284@TK2MSFTNGP02.phx.gbl...
> From: "Mark"
>
>> I manage to run WMP from a command line with a url
>> parameter like http://10.0.0.1:8080. Trying to do so
>> inside my win32 code with ShellExecute , using the
>> appropriate parameters, manages to launch the WMP but
>> without some default target - anyhow not the above url.
>> Can someone advise how to do that with working code
>> please?

>
> Would you care to post your working command line and your non working code
> or should we guess?
>
>
>
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>



 
Unread 03-11-2007, 03:01 PM   #4
Alessandro Angeli
Guest
 
Posts: n/a
Re: Run WMP with ShellExecute

From: "Mark"

> The following code launches WMP but without the right
> parameter i.e. http://10.0.0.11:8080
>
> CString command3 = "http://10.0.0.11:8080";
> ShellExecute(NULL, "open",
> "wmplayer.exe","command3",


command3 and not "command3"

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


 
Unread 03-11-2007, 05:03 PM   #5
Mark
Guest
 
Posts: n/a
Re: Run WMP with ShellExecute

thanks...

Do you know what string, instead of command3, would stop WMP from playing? I
know I can kill the process but I would do that only if I can't simply stop
playing.
Regards

Mark

"Alessandro Angeli" <nobody@nowhere.in.the.net> wrote in message
news:%23orD2UiHIHA.536@TK2MSFTNGP06.phx.gbl...
> From: "Mark"
>
>> The following code launches WMP but without the right
>> parameter i.e. http://10.0.0.11:8080
>>
>> CString command3 = "http://10.0.0.11:8080";
>> ShellExecute(NULL, "open",
>> "wmplayer.exe","command3",

>
> command3 and not "command3"
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>



 
Unread 04-11-2007, 03:03 AM   #6
Alessandro Angeli
Guest
 
Posts: n/a
Re: Run WMP with ShellExecute

From: "Mark"

> Do you know what string, instead of command3, would stop
> WMP from playing? I know I can kill the process but I
> would do that only if I can't simply stop playing.


WMP can not be controlled from the command line by running
multiple instances. These are the available commabd line
paramaters:

http://msdn2.microsoft.com/en-us/library/bb262178.aspx

You can however send WMP's window a WM_COMMAND corresponding
to the Stop menu item or, better yet, a WM_APPCOMMAND
message:

http://groups.google.com/group/micro...826b07b8ab8a54


--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


 
 

Thread Tools
Display Modes



< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 11:09 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional