Changeset 731


Ignore:
Timestamp:
12/6/2008 2:26:19 AM (6 years ago)
Author:
lowjoel
Message:

THIS handling of the command line will allow -q to be passed to prevent a console window from appearing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/ShellExt/CtxMenu.cpp

    r730 r731  
    407407 
    408408        //Build the command line 
     409        std::wstring commandAction; 
    409410        std::wstring commandLine; 
    410411        HRESULT result = E_INVALIDARG; 
     
    414415            { 
    415416                //Add Task command. 
    416                 commandLine = L"addtask "; 
     417                commandAction = L"addtask"; 
    417418 
    418419                //See the invocation context: if it is executed from the recycle bin 
     
    420421                if (InvokeReason == INVOKEREASON_RECYCLEBIN) 
    421422                { 
    422                     commandLine += L"-r"; 
     423                    commandLine = L"-r"; 
    423424                } 
    424425                else 
     
    449450            { 
    450451                //We want to add a new task 
    451                 commandLine = L"addtask "; 
     452                commandAction = L"addtask"; 
    452453 
    453454                //Add every item onto the command line 
     
    455456                    i != SelectedFiles.end(); ++i) 
    456457                { 
    457                     commandLine += L"\"-u=" + *i + ",clusterTips\" "; 
     458                    commandLine += L"\"-u=" + *i + L",clusterTips\" "; 
    458459                } 
    459460                 
     
    503504            ZeroMemory(&processInfo, sizeof(processInfo)); 
    504505             
    505             std::wstring finalCommandLine(L"\"" + eraserPath + L"\" " + commandLine); 
    506             wchar_t* buffer = new wchar_t[finalCommandLine.length() + 1]; 
    507             wcscpy_s(buffer, finalCommandLine.length() + 1, finalCommandLine.c_str()); 
     506            std::wostringstream finalCmdLine; 
     507            finalCmdLine << L"\"" << eraserPath << L"\" \"" << commandAction 
     508                         << L"\" -q " << commandLine; 
     509            std::wstring cmdLine(finalCmdLine.str()); 
     510            wchar_t* buffer = new wchar_t[cmdLine.length() + 1]; 
     511            wcscpy_s(buffer, cmdLine.length() + 1, cmdLine.c_str()); 
    508512 
    509513            if (!CreateProcess(NULL, buffer, NULL, NULL, false, CREATE_NO_WINDOW, 
Note: See TracChangeset for help on using the changeset viewer.