请解释下这段VC代码,越详细越好

来源:百度知道 编辑:UC知道 时间:2024/05/26 04:22:38
void CUDiskMonitorDlg::OnBtnOpen()
{
// TODO: Add your control notification handler code here
TCHAR szCmdLine[MAX_PATH];
_stprintf(szCmdLine, _T("Explorer.exe %s"), m_strDstPath);
#ifdef _UNICODE
USES_CONVERSION;
::WinExec(W2A(szCmdLine), SW_SHOW);
#else
::WinExec(szCmdLine, SW_SHOW);
#endif
}

void CUDiskMonitorDlg::OnBtnOpen()
{
// TODO: Add your control notification handler code here
TCHAR szCmdLine[MAX_PATH];
_stprintf(szCmdLine, _T("Explorer.exe %s"), m_strDstPath); //格式化字符串 假如m_strDstPath = "www.baidu.com" 那么szCmdLine = "Explorer.exe www.baidu.com"

#ifdef _UNICODE
USES_CONVERSION;
::WinExec(W2A(szCmdLine), SW_SHOW); //这里调用Windows系统函数打开浏览器
#else
::WinExec(szCmdLine, SW_SHOW);
#endif
}