Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » how to recognize command line running?(recognition whether i run from a command line or GUI)
icon5.gif  how to recognize command line running? [message #758398] Wed, 23 November 2011 06:32 Go to next message
El ni is currently offline El niFriend
Messages: 8
Registered: February 2010
Junior Member
Hello,
i'm using eclipse and C++.

i want to ask how can i find out from within my code, whether or not i was invoke from command line or GUI???

i have an application that if you double-click it, its open and show you a GUI to work with. i want to make my application to support using a command line without opening the GUI. of course i will supply some additional parameters in the command line.
but how can i recognize from within the code if it has been started for GUI or not?

thanks in advance,
Re: how to recognize command line running? [message #758603 is a reply to message #758398] Wed, 23 November 2011 20:25 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
You can't. You will have to supply a command line argument that says to run in non-gui mode.
Re: how to recognize command line running? [message #758700 is a reply to message #758603] Thu, 24 November 2011 09:54 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
On Linux you could check which process is the parent process of your application. If called from the command line this should be e.g. bash (or another shell!). But I am not sure if this will work reliable.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:new installation - problems with the editor
Next Topic:LoadL proxy on AIX/POWER6 hangs
Goto Forum:
  


Current Time: Thu Apr 25 16:31:21 GMT 2024

Powered by FUDForum. Page generated in 0.02819 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top