Skip to main content



      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 01:32 Go to next message
Eclipse UserFriend
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 15:25 Go to previous messageGo to next message
Eclipse UserFriend
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 04:54 Go to previous message
Eclipse UserFriend
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.
Previous Topic:new installation - problems with the editor
Next Topic:LoadL proxy on AIX/POWER6 hangs
Goto Forum:
  


Current Time: Sun Jul 13 13:47:48 EDT 2025

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

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

Back to the top