主要使用函数ShellExecute
1、打开文件
ShellExecute(0, _T("open"), _T("Explorer.exe"), strFilePath, 0, SW_NORMAL);
2、打开文件夹并设置文件焦点
CString strParam(_T("/select,"));
strParam += strFilePath;
ShellExecute(0, _T("open"), _T("Explorer.exe"), strParam, 0, SW_NORMAL);
(其中strFilePath为文件全路径)
实例:
Win7 + VS2010
http://download.csdn.net/detail/li517411255/5094087