Why is this now wortking?

#include <windows.h>

int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
ShellExecute( NULL, TEXT("open"),
TEXT("C:\Documents and Settings\Josh\My Documents\My Music\Skillet-Hero.wav"),
NULL, NULL, SW_SHOW);
return 0;
}


Error messages

9:77 C:\Dev-Cpp\main.cpp [Warning] unknown escape sequence '\D'
9:77 C:\Dev-Cpp\main.cpp [Warning] unknown escape sequence '\J'
9:77 C:\Dev-Cpp\main.cpp [Warning] unknown escape sequence '\M'
9:77 C:\Dev-Cpp\main.cpp [Warning] unknown escape sequence '\M'
9:77 C:\Dev-Cpp\main.cpp [Warning] unknown escape sequence '\M'

It is just supposed to folow the given path to the correct folder, then open up the file Skillet-Hero.
TEXT("C:\\Documents and Settings\\Josh\\My Documents\\My Music\\Skillet-Hero.wav"),
Seems to be working, but my music did not play :/
"open" isn't quite the same as "play"
Last edited on
The documentation I read on it said nothing about play, but thank-you ounce again.
OLE objects have verbs. It's an old idea that isn't really discussed (or developed) these days.

You can see the verbs that an object offers. For your thing I did:
1. Run REGEDIT.EXE
2. Search for exact string ".wav"
3. I eventually hit an object that supports it. It shows up in it's SupportTypes. On my box, it's wmplayer,exe.
4. The registry keys are below the shell folder. My wmplayer has "open" and "play"

I hope that helps in future.
Topic archived. No new replies allowed.