方法一: 相同的目录会打开多次
string str = "/select, ";
str+=m_pFilePath;//同一个目录
str+=m_pFileName;
str+=".mp4";
ShellExecute(NULL,"open","explorer.exe",str.c_str(),NULL,SW_SHOWNORMAL);
方法二:相同的目录只打开一次,但是需要初始化类库 CoInitialize
CoInitialize(NULL);
string str = m_pFilePath;
str+=m_pFileName;
str+=".mp4";
ITEMIDLIST* pidl = ILCreateFromPath(str.c_str());
if(pidl)
SHOpenFolderAndSelectItems(pidl,0,0,0);
CoUninitialize();