Click here to Skip to main content
13,000,982 members (65,326 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
How to write source code in pause button for windows form application.
This is my video play button code
CleanUp();
 
            m_objFilterGraph = new FilgraphManager();
            string strFileName = DBUtils.ImagePath + "\\" + strFolderName + "\\" + txtFileID.Text.Trim() + ".AVI";
            if (File.Exists(strFileName))
            {
                try
                {
 
                    m_objFilterGraph.RenderFile(strFileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.Trim());
                }
 
                m_objBasicAudio = m_objFilterGraph as IBasicAudio;
 
                try
                {
                    m_objVideoWindow = m_objFilterGraph as IVideoWindow;
                    m_objVideoWindow.Owner = (int)panel2.Handle;
                    m_objVideoWindow.WindowStyle = WS_CHILD | WS_CLIPCHILDREN;
                    m_objVideoWindow.SetWindowPosition(panel2.ClientRectangle.Left,
                        panel2.ClientRectangle.Top,
                        panel2.ClientRectangle.Width,
                        panel2.ClientRectangle.Height);
                }
                catch (Exception)
                {
                    m_objVideoWindow = null;
                }
 
                m_objMediaEvent = m_objFilterGraph as IMediaEvent;
 
                m_objMediaEventEx = m_objFilterGraph as IMediaEventEx;
                m_objMediaEventEx.SetNotifyWindow((int)this.Handle, WM_GRAPHNOTIFY, 0);
 
                m_objMediaPosition = m_objFilterGraph as IMediaPosition;
 
                m_objMediaControl = m_objFilterGraph as IMediaControl;
 

                m_objMediaControl.Run();
                tabCtrlImage.SelectedTab = tbVideo;
                tbVideo.Focus();
            }
            else
                return;
 
        }

any body tell how to write coding in pause button.
Posted 1-Feb-13 0:40am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

It may be ..

m_objMediaControl.Pause()


but Im taking a guess, I dont know your m_objMediaCOntrol is derived from

I would think you would code something like

long my_State;
m_objMediaControl.GetState(1000, my_State);
if (my_State == State_Paused)
{
    m_objMediaControl.Run();
}
else 
{
    m_objMediaControl.Pause();
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100