|
-
Mar 2nd, 2006, 03:08 PM
#1
Thread Starter
Hyperactive Member
Threading issue Help Please
I'v put in a Media Player that i made into my current project and working on using the System.Threading;
My First time really applying the Threading so i need some help with assigning a toolStripButton for the MediaPlayer using Threading and BackgroundWorker this is what i have so far..
Code:
using System;
using System.Threading;
using System.Runtime;
// didnt put in all the Using..
namespace MediaViewer
{
using WMPLib;
using MediaPlayer;
public partial class Form1 : Form
{
private Thread MediaThread = null;
private BackgroundWorker BackgroundWorker1;
{
public Form1()
{
InitializeComponent();
}
private toolStripButton2_Click(object sender, EventArgs e)
{
MediaThread = new Thread(new ThreadStart(this.RunMethod));
if (sender == toolStripButton2)
{
Application.Exit();
if (MediaThread.IsAlive)
MediaThread.Abort();
if (Thread.CurrentThread.IsAlive)
Thread.CurrentThread.Abort();
}
}
private void RunMethod
{
Thread.CurrentThread.IsBackground.GetType();
MediaThread.Start()
// this is where i want too MediaPlayer to run using the toolStripButton2_Click
while using the Thread & BackgroundWorker
}
So any help with this is greatly appreciated i always give out Reputation Points, My 1st time using Threading and BackgroundWorker
Last edited by Rattlerr; Mar 2nd, 2006 at 04:59 PM.
Reason: New Code Insertion
-
Mar 3rd, 2006, 06:13 PM
#2
Frenzied Member
Re: Threading issue Help Please
you need help to start the MediaPlayer.exe by clicking on the button? Or you need help to create the striptoolbutton?
-
Mar 3rd, 2006, 06:19 PM
#3
Thread Starter
Hyperactive Member
Re: Threading issue Help Please
I want the MediaPlayer to have its own Thread..But yes i need the MediaPlayer to Run using the ToolStripButton2 that i already have....
Using Windows Media Player SDK 10 dotnet sample for C#...I'v imported it into my current project...
-
Mar 6th, 2006, 01:30 PM
#4
Frenzied Member
Re: Threading issue Help Please
Then you might want to use the Thread class.
-
Mar 7th, 2006, 09:37 AM
#5
PowerPoster
Re: Threading issue Help Please
but can i ask why you wish for the media player to be in a different thread?
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
|