Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hide console in windows

210 views
Skip to first unread message

Rajil Saraswat

unread,
Jan 23, 2012, 8:59:57 AM1/23/12
to
Hi all,

I have a written a C++ program which calls gnuplot to write out a jpg
of some data. I build a script file with appropriate gnuplot commands
and then use the system command to write out the plot, like this

system("C:\gnuplot\bin\gnuplot.exe c:\data
\gplotcmds.txt);

However this means that a dos/console window pops up everytime gnuplot
is called. Is there any way to hide the console window or use some
other means to call gnuplot. I am not interested in showing any
graphical plot on screen just want the image to be written to disk..

Cheers
Rajil

Petr Mikulik

unread,
Jan 25, 2012, 5:31:21 AM1/25/12
to Rajil Saraswat
> I have a written a C++ program which calls gnuplot to write out a jpg
> of some data. I build a script file with appropriate gnuplot commands
> and then use the system command to write out the plot, like this
>
> system("C:\gnuplot\bin\gnuplot.exe c:\data \gplotcmds.txt);
>
> However this means that a dos/console window pops up everytime gnuplot
> is called. Is there any way to hide the console window or use some
> other means to call gnuplot.

On OS/2, there is a command "start" which allows to pass several options to
a newly started window, e.g. minimized, maximized, in background, etc.
I think the same command is available on Windows as well.
Then something like system("start /background /minimized gnuplot ...") might
work as you expect.

Otherwise, use popen() to pass commands directly.

---
PM

0 new messages