(e-mail address removed) wrote in (e-mail address removed):
On May 7, 8:02 pm, Daniel Pitts [...]
I m Not a Beginner but i don't know anything about it.
i search its archive but all are showing "PlaySound" Function with the
"windows.h" header and i m user of "g++"
its not working there. so what should i use for it.
g++ works also in Windows and presumably is able to include
<windows.h> (if you have downloaded and installed the Windows
SDK first of course).
If you are not on Windows you have to find other means. On
Linux a simple bash script should be enough for such things,
no need for C++.
In general, if the goal is just to play some background music,
and no real interaction is involved, the best solution is likely
to be to figure out the system dependent command line request to
do it, and invoke that via the system() function. On most
systems, system() will return something which can later be
converted into a command line request to kill the process, if
that's needed as well. (On the systems I'm familiar with,
system returns the process id, and something like:
std:
stringstream cmd ;
cmd << "kill " << systemReturnValue ;
system( cmd.str().c_str() ) ;
can be used to stop the process.)