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?
Re: Is it possible to show a console window in GUI_APP_MAIN? [message #19006 is a reply to message #18731] Wed, 05 November 2008 06:35 Go to previous message
sevenjay is currently offline  sevenjay
Messages: 30
Registered: October 2008
Location: Taiwan
Member
mr_ped wrote on Sat, 18 October 2008 21:36

Maybe you can also check TheIDE internal console used to output compilation/search/run input/output when used together with "Debug/Run options../Standard output: Console".

This one works in the same way both under windows and linux and it's faster than ordinary shell (bash or cmd.exe).
I'm just not sure about input possibilities, and where to look for this one in the TheIDE sources.

Thanks for your idea.
The console will be in the TheIDE and can not input anything to itself.
Well.... I did it by using xterm in Linux. You can try "cmd /K dir" command if you want to do it In windows.
Here is the sample code:
int exec_xterm()
{
	const char * temp_argv[100]={"xterm", "-sb", "-rightbar", "-hold", "-e", "sudo", "ls", NULL};
	char * const * send_argv=(char * const * )temp_argv;//force convert type
	
	pid_t pid = fork();//------------------------------------------------------
	
	switch(pid) {
		case -1:	//parent fork failed
			perror("parent fork failed");
			return FORK_FAIL;
			break;
		case  0:	//child process
			if(-1==execvp(send_argv[0],send_argv));
			{
				perror("exec failed");
				return EXEC_FAIL;
			}
			break;
		default:	//parent process
			wait(NULL);
			return OK;
			break;
	}
	//-----------------------------------------------------------
}


Hope it may be helpful for someone...

[Updated on: Wed, 05 November 2008 06:38]

Report message to a moderator

 
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: Sun May 05 21:50:39 CEST 2024

Total time taken to generate the page: 0.02966 seconds