Click here to Skip to main content

C / C++ / MFC

 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pinmemberho_khalaf26-Nov-12 13:02 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? PinmemberDavidCrow26-Nov-12 17:39 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pinmemberho_khalaf26-Nov-12 20:26 
QuestionC++: CreateProcess() launching child applications with UAC dialog for once PinmemberFarrukhw26-Nov-12 0:58 
Dear Community,
 
I'm using C++ to develop a small Bootstrapper (Setup.exe) application in C++. Using CreateProcess() to launch a .hta (HTML Application) which is used as a UI. It then calls other installers one by one which includes *.exe, *.msi etc.
 
What I'm trying to do is if I execute my Setup.exe, it asked for UAC for once and launch .hta so that it doesn't required UAC any further. Here is my code:
 STARTUPINFO si;
    PROCESS_INFORMATION pi;
 
    ZeroMemory( &si, sizeof(si) );
    si.cb = sizeof(si);
	
    ZeroMemory( &pi, sizeof(pi) );
	
 
	if( CreateProcess(NULL,   // No module name (use command line)
       "C:\\Windows\\MsHta.exe SetupGUI.hta"    // 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            // Pointer to PROCESS_INFORMATION structure
		))
	{
 
	// Wait until child process exits.
    WaitForSingleObject(pi.hProcess, INFINITE );
 
    // Close process and thread handles. 
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
 
I actually saw same in an application installer, but I don't have its Setup.exe's source code.
 
Thanks a lot.
 
Farrukh
AnswerRe: C++: CreateProcess() launching child applications with UAC dialog for once PinmemberAndrew Cherednik26-Nov-12 13:21 
QuestionHow to use NTGraph3D Activex Control in Visual Studio 2010. PinmemberDhrumilS23-Nov-12 1:48 
AnswerRe: How to use NTGraph3D Activex Control in Visual Studio 2010. PinmvpRichard MacCutchan23-Nov-12 2:43 
QuestionHow to get a ip address from system name [modified] PinmemberD.Manivelan22-Nov-12 23:20 
AnswerRe: How to get a ip address from system name Pinmembermsr_codeproject23-Nov-12 0:23 
AnswerRe: How to get a ip address from system name PinmemberRolf Kristensen23-Nov-12 1:41 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.150326.1 | Last Updated 26 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid