|
|
Hi everyone
i am trying to code a program that should be able to play videos besides other features.
I thought it would be easiest to accomplish the task by just integrating the Windows Media Player-COM-Object, but i couldn't get the controls to disappear (i want my own user-interface..). I read about mediaplayer-integration in a book called 'Advanced C# Programming' by Paul Kimmel. But he seemed to use a different com-object and the demo-app to that chapter doesn't compile (can't find the reference to AxMediaPlayer). The only COM-object i found, that looks like it has really something to do with the mediaplayer is this: AxWMPLib.AxWindowsMediaPlayer. But with this one i get these nasty mediaplayer-controls that i can't get rid of.
Can anybody help me with this, or does somebody know a better solution?
thanks in advance
|
|
|
|
|
i just downloaded the media player 9 SDK and tried to compile the c#-sample (named tune-clipper). As written i registered the wmppia.dll with regasm.exe and installed it with gacutil.exe (Global Assembly Cache Utility). This seemed to be successful. But as i tried to compile the tuneclipper i stumbled accross compile-errors (actually 18 of the same kind):
D:\dev\SDKs\WMSDK\WMPSDK9\samples\dotNet\csharp\Form1.cs(689): 'AxMicrosoft.MediaPlayer.Interop.AxWindowsMediaPlayer' does not contain a definition for 'controls'
I get this one when a call to Player.controls.xxx is made. Player is defined as 'private AxMicrosoft.MediaPlayer.Interop.AxWindowsMediaPlayer'. Player.controls seems to be undefined.. very strange.. (i guess Microsoft-code is supposed to run..)
Does anybody know a way out?
|
|
|
|
|
I'm not sure but I think the you may use the property 'uiMode'. Valid values are "none", "mini", and "full"... eg...
wmp1.uiMode = "none";
Also.. If you don't want the context menu for the Windows Media Control , use
wmp1.enableContextMenu = false; // true to turn it back on
Hope that helps..
Yippee Kai Yai
Signed Polomint.......
|
|
|
|
|
Yup, thanks.
does your mediaplayer have the 'controls'-property?
As i wrote, mine somehow doesn't. Without it i can't really control media-files. All the play-, stop- and pause-methods are in there.
|
|
|
|
|
I've just checked for the controls property and I do have it.
wmp.Controls( int index );
I assume that the index is the index of the play/pause controls etc.
Are you using Visual Studio? I use VS2003, and all I do is add the Windows Media Player COM component to the toolbox, then use it.
HTH
John
|
|
|
|
|
Damn, my post was hijacked by Anonymous !!!!
I've just checked for the controls property and I do have it.
wmp.Controls( int index );
I assume that the index is the index of the play/pause controls etc.
Are you using Visual Studio? I use VS2003, and all I do is add the Windows Media Player COM component to the toolbox, then use it.
HTH
John
Yippee Kai Yai
Signed Polomint.......
|
|
|
|
|
damn hijackers
I use VS2003, too. At first i just integrated the mediaplayer in my toolbox like you. But as i found out i didn't have that controls-interface in my mediaplayer (but the microsoft-one has) i downloaded the SDK. I still can't compile their sample-app.
Btw: I have a Controls-interface.. but not the one that microsoft in the sample uses . But i can't type wmp.Controls(myindex); because in my VS2003 it's not a method.. In the microsoft-sample it's also written lowercase ('controls') and it has functions like play, stop and pause.
This friggin thing is starting to go on my nerves.. why can't it just work as it's supposed to be.. or at least as the help tells me it works..
|
|
|
|
|
Does anyone have a class for manipulating the windows volume controls from within a c# program? Thanks to other articles posted in the site I've been able to integrate CD playing in my applicatoin and now I want to control the volume as well.
Thanks in advance.
|
|
|
|
|
You could use a TrackBar derived control for this.
Try this code, it works yet leaves room for you to play with:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class VolumeControl : TrackBar
{
[DllImport("winmm.dll")]
private static extern int waveOutSetVolume(IntPtr device, UInt32 vol);
public VolumeControl()
{
base.Minimum = 0;
base.Maximum = 0xffff;
base.TickFrequency = 4096;
base.SmallChange = 4096;
base.LargeChange = 8192;
this.ValueChanged += new EventHandler(VolumeControl_ValueChanged);
}
private void VolumeControl_ValueChanged(object sender, EventArgs e)
{
waveOutSetVolume(IntPtr.Zero, (uint)(Value|Value<<16));
}
}
Regards,
mav
|
|
|
|
|
Works for setting the wave/mp3 volume but not for accessing the CD volume.
Other ideas?
|
|
|
|
|
You're right, if you want to specifically target the CD volume only, then you'll have to use the Win32 mixer* functions.
But beware, the whole process will become a bit complex and correct declaration of the functions for P/Invoke is crucial.
This link should get you started, though:
Audio Mixer Reference
Regards,
mav
|
|
|
|
|
I designed a dataDrid (with C#) with ColumnStyles --> DataGridBoolColumn
and i want this column to respond to only one click
can any one help me ?
|
|
|
|
|
Hi,
Please Check @ http://www.syncfusion.com/faq/winforms/
Happy Coding
|
|
|
|
|
I've been doing a lot of GDI programing while making custom controls and the thing that frustrates me the most is not knowing if you made a mistake.
Does any know of any helpful tools for GDI programming. GDI programming is almost like drawing with your left hand in a paper bag. It would be nice if there was some sort of testing framework / tool that would make it easier to see what you are doing.
|
|
|
|
|
Nothing against writing in a paper bag with the left hand....it's quite easy....especially if you are a left-handed person like me
|
|
|
|
|
Hey guys,
I'm working on sort of a "proof of concept" program (using .NET and C#) that will generate random reply's to forum posts. My program takes a URL, which would be the URL of the page I am replying to, and submits a reply that is pulled from a word list. I'm trying to figure out the best way to open a connection to the page, and then put my mouse-pointer in the "message" box. I can't pass the message as a URL parameter or anything of the sort, because the forums are php/asp. So, does anyone have any ideas as to the best way to open a connection to the page, or on how to get "into" the reply box? To give you an idea, use my test board @ http://s6.invisionfree.com/Justin, and try replying to a post in the Concept forum - this is the process I want to automate. I just need some ideas on the best way to accomplish this...any suggestions are welcome.
Thanks,
Justin
|
|
|
|
|
Ok, well I figured out how to get IE started and go to the correct URL. I'm using System.Diagnostics.Process.Start("executable", "url"). Now I need to figure out how to "grab" the window, insert my text into the reply box, and hit the submit button... Suggestions/examples are appreciated.
Thanks,
Justin
|
|
|
|
|
|
Hi guys and girls.
Do anyone here know if it possible to read and possible change settings storped in a outlook pst file ?
What i want to do is changing the SMTP server settings in my pst files on the fly. The reason for wanting to do this is that i move my laptop around on 6-7 different networks and then i always have to change my smtp settings so i can send emails..
Thanks
|
|
|
|
|
I did not think that your SMTP setting were stored in the PST files. They are just files that contain the messages (as well as other types of Outlook data).
I belive your email settings are stored elsewhere.
Registry perhaps?
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
The Outlook PST file is a message store (Personal Store file). It doesn't contain any settings for servers. Those are in the registry under HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts (for Outlook Express). I can't remember what path they're under for Outlook. Your best bet for managing those is the Microsoft Outlook xx.0 object library.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Outlook XP and 2003 doesnt store the settings in the Registry and i belive i read somewhere that they started encrypting it into the pst file..
Outlook express settings are stil stored in the registry
|
|
|
|
|
That is incorrect. I haven't auto archived anything in Outlook on my laptop so there aren't any .pst files on my computer. The SMTP Server on my computer is stored in the following hive as a REG_BINARY with a key name of SMTP Server :
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000007
- Nick Parker My Blog | My Articles
|
|
|
|
|
There not in the PST files, but no matter where they're stored, my original recommendation still stands. The Microsoft Outlook xx.0 Object library is the way to go...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|