|
我这里一个可以正常运行的例子,楼主试了还不行,就只能是楼上所说的原因啦!
BOOL LoadMediaFromListView(HWND hWndList, long nItem, PCWSTR pFilePath)
{
TCHAR pFile[256], pBuf[256];
//得到文件名
ListView_GetItemText(hWndList, nItem, 0, pBuf, 256);
wsprintf(pFile, TEXT("%s%s"), pFilePath, pBuf);
//用媒体播放器播放文件
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = L"\\windows\\ceplayer.exe";
ShExecInfo.lpParameters = pFile;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
return FALSE;
} |
|