ShellExecute 函数总结

来源:互联网 发布:找淘宝达人合作流程 编辑:程序博客网 时间:2024/04/23 16:56

1 文件定位功能实现

   CString strPicPath; 

   strPicPath = alarmlist->GetItemText(nItem, 3);//此时 strPicPath值为:“d://123.bmp” 

   strPicPath="/e,/select,"+strPicPath;

   方法1: ShellExecute(NULL,"open","explorer.exe",strPicPath,NULL,SW_SHOW);//就是利用Explorer.exe有个/select参数

   方法2: ShellExecute(NULL,NULL,"explorer",strPicPath,NULL,SW_SHOW);