如果执行ShellExecute函数打开文件时,文件没有指定相应的打开方式,则可以使用如下函数调用“打开方式...”对话框。
其中strName是文件名,pszFolder是路径.
int nRes = (int)ShellExecute(NULL, "open", strName, "", pszFolder, SW_SHOWDEFAULT);
if(SE_ERR_NOASSOC == nRes)
{
CString strCmd;
strCmd.Format("rundll32 shell32, OpenAs_RunDLL %s", strName);
WinExec(strCmd, SW_SHOWNORMAL);
}
相关文章:
-
2021-11-21
-
2021-12-27
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-12-23
猜你喜欢
-
2021-11-07
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-01-20
-
2022-12-23
-
2021-06-07
相关资源
-
下载
2023-01-01
-
下载
2023-01-24
-
下载
2021-06-05
-
下载
2022-12-02