请问怎么使用ShellExcute这个函数?它需要包含什么头文件?

解决方案 »

  1.   

    用法很多,如下:
    ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);
    ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
    ShellExecute(handle, "find", path_to_folder, NULL, NULL, 0);...查MSDN
    要包含:
    Shellapi.h
      

  2.   

    cq.cpp
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2065: 'HDROP' : undeclared identifier
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2146: syntax error : missing ';' before identifier 'UINT'
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2501: 'DECLSPEC_IMPORT' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.cq.exe - 5 error(s), 0 warning(s)
    我用了之后,报了以上错误