Click here to Skip to main content
15,918,471 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem Called Bee Breading Pin
Talal Sultan27-Apr-07 4:57
Talal Sultan27-Apr-07 4:57 
AnswerRe: Problem Called Bee Breading Pin
Adeel Chaudhry27-Apr-07 7:23
Adeel Chaudhry27-Apr-07 7:23 
GeneralRe: Problem Called Bee Breading Pin
Luc Pattyn27-Apr-07 10:36
sitebuilderLuc Pattyn27-Apr-07 10:36 
AnswerRe: Problem Called Bee Breading Pin
Wes Aday27-Apr-07 9:29
professionalWes Aday27-Apr-07 9:29 
Questionwindows service and PHP Pin
xx5827-Apr-07 4:14
xx5827-Apr-07 4:14 
Questionc# datagrid - word wrap [modified] Pin
Ananthalvan27-Apr-07 4:11
Ananthalvan27-Apr-07 4:11 
AnswerRe: c# datagrid - word wrap Pin
Adeel Chaudhry27-Apr-07 4:20
Adeel Chaudhry27-Apr-07 4:20 
GeneralRe: c# datagrid - word wrap Pin
Ananthalvan14-May-07 7:48
Ananthalvan14-May-07 7:48 
QuestionHTMLDocument problem Pin
v-lokki27-Apr-07 4:02
v-lokki27-Apr-07 4:02 
AnswerRe: HTMLDocument problem Pin
Sathesh Sakthivel27-Apr-07 4:07
Sathesh Sakthivel27-Apr-07 4:07 
GeneralRe: HTMLDocument problem Pin
v-lokki27-Apr-07 4:12
v-lokki27-Apr-07 4:12 
QuestionSocket programming Pin
Rahul Babu27-Apr-07 3:55
Rahul Babu27-Apr-07 3:55 
AnswerRe: Socket programming Pin
Adeel Chaudhry27-Apr-07 4:01
Adeel Chaudhry27-Apr-07 4:01 
QuestionRegarding comboBox [modified] Pin
praveenkumar palla27-Apr-07 3:32
praveenkumar palla27-Apr-07 3:32 
AnswerRe: Regarding comboBox Pin
Adeel Chaudhry27-Apr-07 3:56
Adeel Chaudhry27-Apr-07 3:56 
GeneralRe: Regarding comboBox Pin
praveenkumar palla27-Apr-07 4:16
praveenkumar palla27-Apr-07 4:16 
QuestionEmpty matrix Pin
Russell'27-Apr-07 3:32
Russell'27-Apr-07 3:32 
AnswerRe: Empty matrix Pin
Jimmanuel27-Apr-07 3:56
Jimmanuel27-Apr-07 3:56 
GeneralRe: Empty matrix Pin
Russell'27-Apr-07 4:19
Russell'27-Apr-07 4:19 
QuestionMediaPlayer Pin
kraj9927-Apr-07 2:39
kraj9927-Apr-07 2:39 
hello everyone,

I am trying out a few things with MediaPlayer. I am currently creating the Windows Media Player Control Programmatically(i.e without adding a MediaPlayer control into the Application, I need to run it)

After downloading the MediaPlayer SDK and adding wmp.dll reference,
I am using the below code to do this.



WMPLib.WindowsMediaPlayer Player;

private void PlayFile(String url)
{
Player = new WMPLib.WindowsMediaPlayer();
Player.PlayStateChange +=
new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(Player_PlayStateChange);
Player.MediaError +=
new WMPLib._WMPOCXEvents_MediaErrorEventHandler(Player_MediaError);
Player.URL = url;
Player.controls.play();
}

private void Form1_Load(object sender, System.EventArgs e)
{
// TODO Insert a valid path in the line below.
PlayFile(@"c:\myaudio.wma");
}

private void Player_PlayStateChange(int NewState)
{
if ((WMPLib.WMPPlayState)NewState == WMPLib.WMPPlayState.wmppsStopped)
{
this.Close();
}
}

private void Player_MediaError(object pMediaObject)
{
MessageBox.Show("Cannot play media file.");
this.Close();
}

Problem:
I got the above code from MSDN and it is playing the video file at the background but I am not able to see the MediaPlayer on the monitor. I can just hear the audio of the file. Can someone tell me what the problem is.
There is nothing wrong with the windows media player as far as I know

Thanks and Regards
kraj
AnswerRe: MediaPlayer Pin
Adeel Chaudhry27-Apr-07 3:48
Adeel Chaudhry27-Apr-07 3:48 
GeneralRe: MediaPlayer Pin
kraj9929-Apr-07 20:57
kraj9929-Apr-07 20:57 
QuestionLink on "Today" (pocket pc 2003 / Wm5) Pin
AlexB4727-Apr-07 2:26
AlexB4727-Apr-07 2:26 
QuestionHow vertical the datagrid view Pin
Doan Nguyen27-Apr-07 2:21
Doan Nguyen27-Apr-07 2:21 
AnswerRe: How vertical the datagrid view Pin
Adeel Chaudhry27-Apr-07 4:16
Adeel Chaudhry27-Apr-07 4:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.