I'm writing a program called the Random Chronological Audio/Video Selection Device. What it will do is select files from certain folders in My Documents at random and play them on WMP, just like WMP will do if you set it to random; but on top of that I want to have the files selected also according to the time of the day, so that way I can wake up to Hey Arnold at 7am, be listening to Red Hot Chili Peppers at 12pm, and fall asleep to soothing rain drop music at 9pm. The program plays tracks all day one after another so there isn't a moment in which there isn't some sound coming out of my computer.
So far I've gotten the program to select random files from any destination and play them continuously, but I have to close WMP manually before the program continues on to the next track. How can I tell my program to close WMP after the track is completed, or how can the next track be selected without having to close WMP? Is there a way to do this just with C or do I have to use some sort of API?
Thanks in advance