Click here to Skip to main content
15,887,477 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Handling mouse using OS interrupts Pin
Software_Developer16-Feb-14 3:28
Software_Developer16-Feb-14 3:28 
GeneralRe: Handling mouse using OS interrupts Pin
myth199017-Feb-14 2:29
myth199017-Feb-14 2:29 
GeneralRe: Handling mouse using OS interrupts Pin
myth199022-Feb-14 17:59
myth199022-Feb-14 17:59 
GeneralRe: Handling mouse using OS interrupts Pin
Richard MacCutchan16-Feb-14 2:15
mveRichard MacCutchan16-Feb-14 2:15 
GeneralRe: Handling mouse using OS interrupts Pin
myth199016-Feb-14 2:21
myth199016-Feb-14 2:21 
GeneralRe: Handling mouse using OS interrupts Pin
Richard MacCutchan16-Feb-14 2:28
mveRichard MacCutchan16-Feb-14 2:28 
GeneralRe: Handling mouse using OS interrupts Pin
myth199016-Feb-14 2:32
myth199016-Feb-14 2:32 
Questionredirecting output of CMD with administrator privileges Pin
camillo8715-Feb-14 1:29
camillo8715-Feb-14 1:29 
Hello!
I have following problem. I want to create a application, which is using Netsh. I have created following code:

C++
private: System::Void button1_Click( System::Object ^ sender, System::EventArgs ^ e ) {
   
    Process ^ mojProces = gcnew Process();
    ProcessStartInfo ^ startInfo = gcnew ProcessStartInfo( "cmd.exe" );
    startInfo->Verb = "runas";
    startInfo->Arguments =( "Administrator /c \"netsh wlan start hostednetwork\" " );
    startInfo->UseShellExecute = false;
    startInfo->CreateNoWindow = true;
    startInfo->RedirectStandardOutput = true;
    startInfo->RedirectStandardInput = true;
    info->Text = "Sieć została uruchomiona.";
    mojProces->StartInfo = startInfo;
    mojProces->Start();
   
    StreamReader ^ wynik = mojProces->StandardOutput;
    String ^ wynik_konsoli = wynik->ReadToEnd();
    wynik_wysw->Text = wynik_konsoli;
    mojProces->WaitForExit();
    mojProces->Close();


Now I would like to redirect output of CMD, but there is following problem. When I set UseShellExecute=false, I cannot run CMD with administrator privileges, which is required to use Netsh. But when I set true I cannot redirect output. Could you please help, how can I solve this problem? Thank you in advance!
AnswerRe: redirecting output of CMD with administrator privileges Pin
Richard Andrew x6415-Feb-14 10:23
professionalRichard Andrew x6415-Feb-14 10:23 
SuggestionRe: redirecting output of CMD with administrator privileges Pin
David Crow15-Feb-14 11:10
David Crow15-Feb-14 11:10 
Questionhow to read character by character from text file in c++? Pin
sajedevahedi14-Feb-14 10:32
sajedevahedi14-Feb-14 10:32 
AnswerRe: how to read character by character from text file in c++? Pin
jeron114-Feb-14 10:56
jeron114-Feb-14 10:56 
GeneralRe: how to read character by character from text file in c++? Pin
sajedevahedi14-Feb-14 11:18
sajedevahedi14-Feb-14 11:18 
GeneralRe: how to read character by character from text file in c++? Pin
jeron114-Feb-14 11:30
jeron114-Feb-14 11:30 
AnswerRe: how to read character by character from text file in c++? Pin
Richard MacCutchan14-Feb-14 22:43
mveRichard MacCutchan14-Feb-14 22:43 
AnswerRe: Just put the 'file.get' into a 'while' statement. Pin
Software_Developer15-Feb-14 1:51
Software_Developer15-Feb-14 1:51 
AnswerRe: how to read character by character from text file in c++? Pin
leon de boer4-Mar-14 15:03
leon de boer4-Mar-14 15:03 
QuestionC program help Pin
MalDrHoop14-Feb-14 6:00
MalDrHoop14-Feb-14 6:00 
AnswerRe: C program help Pin
jeron114-Feb-14 6:06
jeron114-Feb-14 6:06 
GeneralRe: C program help Pin
MalDrHoop14-Feb-14 6:11
MalDrHoop14-Feb-14 6:11 
GeneralRe: C program help Pin
jeron114-Feb-14 6:21
jeron114-Feb-14 6:21 
GeneralRe: C program help Pin
MalDrHoop14-Feb-14 6:34
MalDrHoop14-Feb-14 6:34 
GeneralRe: C program help Pin
jeron114-Feb-14 6:38
jeron114-Feb-14 6:38 
GeneralRe: C program help Pin
MalDrHoop14-Feb-14 6:46
MalDrHoop14-Feb-14 6:46 
GeneralRe: C program help Pin
jeron114-Feb-14 6:50
jeron114-Feb-14 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.