ShellExecute(this->m_hWnd,"explore", "C:\工具","","", SW_SHOW );
路径里出现了 中文 导致 打开文件夹 这个功能失效,请求哪位高手指点一下如何处理,感激不尽!

解决方案 »

  1.   

    ShellExecute(this->m_hWnd,"explore", "C:\工具","","", SW_SHOW );
    应该是
    ShellExecute(this->m_hWnd,"explore", "C:\\工具","","", SW_SHOW );
      

  2.   

    ShellExecute(this->m_hWnd,"explore", "C:\\工具","","", SW_SHOW );
      

  3.   

    ShellExecute(this->m_hWnd, _T("explore"), _T("C:\工具"), _T(""), _T(""), SW_SHOW );
      

  4.   

    ShellExecute(this->m_hWnd, _T("explore"), _T("C:\\工具"), _T(""), _T(""), SW_SHOW );
      

  5.   

    ShellExecute(this->m_hWnd,"explore", "C:\\工具","","", SW_SHOW );
    or
    TCHAR szApp[MAX_PATH] = _T("explore.exe");
    TCHAR szCmdLine[MAX_PATH] = _T("C:\\工具");
    STARTUPINFO si = {sizeof(si)};
    PROCESS_INFORMATION pi = {0};
    if(CreateProcess(szApp, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
    {
     CloseHandle(hThread);
     CloseHandle(hProcess);
    }
      

  6.   

    ShellExecute(this->m_hWnd,"explore", "C:\工具","","", SW_SHOW );
    应该是
    ShellExecute(this->m_hWnd,"explore", "C:\\工具","","", SW_SHOW );
    跟中文没关系,主要是转义字符 \\