Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » Is it possible to show a console window in GUI_APP_MAIN?
Is it possible to show a console window in GUI_APP_MAIN? [message #18680] Thu, 16 October 2008 10:36 Go to previous message
sevenjay is currently offline  sevenjay
Messages: 30
Registered: October 2008
Location: Taiwan
Member
Well.....I know maybe it's a stupid question.
Is it possible to show a console window in GUI_APP_MAIN?

In my application, I have a command need users input their password and they can see the log of the command.
To have users' trust, I don't want to send pw from GUI then catch log back from the command message.

On Linux the code example is like this:
function called in GUI_APP_MAIN
int function()
{
	printf("this is a test program\n");

	const char * send_argv[]={"sudo","ls","-al",NULL};
	pid_t pid = fork();
	switch(pid) {
		case -1:	//parent fork failed
			return P2M_FORK_FAIL;
			break;
		case  0:	//child process
			if(-1==execvp(send_argv[0], send_argv)); //execvp("sudo",{"sudo","ls","-al",NULL})
				return P2M_EXEC_FAIL;
			break;
		default:	//parent process
			wait(NULL);
			return P2M_OK;
			break;
	}
}

But even printf() can not show a message...
If there is any idea, please tell me.
Thanks a lot!
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: windows dont close except by to calls
Next Topic: Add public method IsVisible() TrayIcon
Goto Forum:
  


Current Time: Fri Apr 26 02:03:10 CEST 2024

Total time taken to generate the page: 0.02322 seconds