1 Replies - 625 Views - Last Post: 28 November 2015 - 10:18 AM Rate Topic: -----

#1 abhi64742   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 14-September 15

How to starts and stops an application after certain time interval.

Posted 28 November 2015 - 03:34 AM

I want to create an application that should start at a certain given time and should play a video and after the video is completly palyed then it should minimize and after a certain time interval it should again start and repeat the same process. I have completed the part of playing video but i am confused in how to start that application on a certain time.
Thank you in advance.
Is This A Good Question/Topic? 0
  • +

Replies To: How to starts and stops an application after certain time interval.

#2 IronRazer   User is offline

  • Custom Control Freak
  • member icon

Reputation: 1499
  • View blog
  • Posts: 3,797
  • Joined: 01-February 13

Re: How to starts and stops an application after certain time interval.

Posted 28 November 2015 - 10:18 AM

You can create a project that has an AxWindowsMediaPlayer control on it and set the Form`s WindowState property to Minimized. Then use a constantly running Timer to keep monitoring the Time. You can compare the DateTime.Now Property or even the DateTime.TimeOfDay Property with your specified Time. When the Time is right, set the Form`s WindowState to Normal or Maximized and play the video.

You can use the AxWindowsMediaPlayer`s PlayStateChange Event to detect when the video has ended or has been stopped by the user. You can then set the WindowState back to Minimized again.

However, you will need to add a shortcut to your application in the Startup folder so that when you log in the application starts and the Timer can start checking the Time.

You can check the link below where i have an example of how to create a shortcut to your application in the startup folder from your application. You could also just add one manually or when your app is being installed.

Create a shortcut for your app from your app
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1