faborite music - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

faborite music

chmod14chmod14 Posts: 1Member
Hi there is this song that I like so much and I would like it to be played every morning by 8 am. I need help in writing a C++ program that will do that for me. I would appreciate this as it would allow me to learn also.

Comments

  • LundinLundin Posts: 3,711Member
    This is most easily achieved with the scheduler features in Windows.

    If you still want to make a program, be aware that this is not exactly a beginner's task. If you have never done Windows API programming, learning how to do so by making this program will be pretty steep. You need to do the following:

    - Find out how to make your program running from PC startup. This is done through some registry settings. If you want your program to register itself, you need to learn how to access the registry with Windows API functions. Less advanced is to simply put your program below "auto run" manually.

    - Find out how to access the Windows clock through the Windows API.

    - Write the program so that it is sleeping most of the time (not consuming CPU power), but checking the clock every minute or so. The Sleep() function is the easiest way to achieve this.

    - Find out how to execute another program from your own program. Again, the Win API: ShellExecute() or CreateProcess. Launch your mp3 player through these functions and pass the file name of the song as command line parameter.
Sign In or Register to comment.