一个函数搞定
BOOL ShellExecuteEx(
    LPSHELLEXECUTEINFO lpExecInfo
);

解决方案 »

  1.   


    对呀,很easy.
    ShellExecute(...)指定程序路径不就解决了吗?
      

  2.   

    还可以用CreateProcess
    BOOL CreateProcess(
      LPCTSTR lpApplicationName,                 // name of executable module
      LPTSTR lpCommandLine,                      // command line string
      LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
      LPSECURITY_ATTRIBUTES lpThreadAttributes,  // SD
      BOOL bInheritHandles,                      // handle inheritance option
      DWORD dwCreationFlags,                     // creation flags
      LPVOID lpEnvironment,                      // new environment block
      LPCTSTR lpCurrentDirectory,                // current directory name
      LPSTARTUPINFO lpStartupInfo,               // startup information
      LPPROCESS_INFORMATION lpProcessInformation // process information
    );
      

  3.   

    我!想要的就是文件路径。
    littlecatie(tryer)请具体说一下,中文
      

  4.   

    在OnButtonClick事件中写如下代码,就可以在单击按钮时运行myprogram: 
        STARTUPINFO si;
        PROCESS_INFORMATION pi;    ZeroMemory( &si, sizeof(si) );
        si.cb = sizeof(si);
        ZeroMemory( &pi, sizeof(pi) );    CreateProcess("D:\\Documents and Settings\\catie\\桌面\\myprogram.exe",
            "MyChildProcess", // Command line. 
            NULL,             // Process handle not inheritable. 
            NULL,             // Thread handle not inheritable. 
            FALSE,            // Set handle inheritance to FALSE. 
            0,                // No creation flags. 
            NULL,             // Use parent's environment block. 
            NULL,             // Use parent's starting directory. 
            &si,              // Pointer to STARTUPINFO structure.
            &pi );
      

  5.   

    SHGetSpecialFolderLocation
    ShellExecute
      

  6.   

    或者这样也可以:
    ShellExecute(NULL,"open","D:\\Documents and Settings\\catie\\桌面\\vbreporttest.exe",NULL,NULL,SW_SHOW );
      

  7.   

    ShellExecute(……)是不是只能执行*.exe文件?
    “我的电脑”是哪个exe文件啊?
      

  8.   

    HRESULT hr;
       LPMALLOC pMalloc = NULL;
       LPITEMIDLIST pidl= NULL;
       VARIANT vPIDL = {0}, vDummy = {0};
       SHELLEXECUTEINFO  sei;   if (FAILED(OleInitialize(NULL)))
       {
          return;
       }   // Get the pidl for your favorite special folder,
       // in this case literally, the Favorites folder
       if (FAILED(hr = SHGetSpecialFolderLocation(NULL,
              CSIDL_DRIVES , &pidl)))
       {
          goto Error;
       }   ZeroMemory(&sei, sizeof(sei));
       sei.cbSize = sizeof(sei);
       sei.fMask = SEE_MASK_IDLIST | SEE_MASK_CLASSNAME;
       sei.lpIDList = pidl;
       sei.lpClass = TEXT("folder");
       sei.hwnd = ::GetDesktopWindow();
       sei.nShow = SW_SHOWNORMAL;   sei.lpVerb = TEXT("explore");//sei.lpVerb = TEXT("open");
       ShellExecuteEx(&sei);   SHGetMalloc(&pMalloc);
       if(pMalloc){
          pMalloc->Free(pidl);
          pMalloc->Release();
       }
      

  9.   

    楼上的说啦!用SHGetSpecialFolderLocation来得到你要的虚拟文件夹,得到ITEMIDLIST后,你想这么样就能怎么样啦!这要用到
    命名空间,详细的找点资料看吧!
    在Cj60里有这样的例子!