Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-07

Executable with invisible window and IO enabled

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

luciano de souza

hello all,
I want to compile a program with no visible screen, but at the same time, with input and output enabled.
If I use $apptype gui, the screen is invisible, but there are not input and output.
If I use the standard $apptype console, the input and output is enabled, but the screen is visible.
In Windows, how to obtain the both effects simultaneously? Brook has an embeded web server. With one click on the executable, the web server is opened. However, it's not my intention to keep the window visible. Otherwise, the browser will read data from the input and write data to the output. So, I really need invisibility and enable IO.
Regards,
Luciano

Reply by email

Michael Van Canneyt
to luciano de souza
luciano de souza wrote 5 lines
hello all, I want to compile a program with no visible screen, but at the same time, with input and output enabled. If I use $apptype gui, the screen is invisible, but there are not input and output.

Correction: there is input and output, just not standard input and output. (the console, if you want)

Show quoted text 7 lines
If I use the standard $apptype console, the input and output is enabled, but the screen is visible. In Windows, how to obtain the both effects simultaneously? Brook has an embeded web server. With one click on the executable, the web server is opened. However, it's not my intention to keep the window visible. Otherwise, the browser will read data from the input and write data to the output.

It should not. A webserver reads/writes to port 80.

If it reads/writes to standard input/output, it only diagnostic information.

You should compile this app with $apptype GUI, and disable all diagnostic information (i.e. comment out all writeln statements)

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
You should compile this app with $apptype GUI, and disable all diagnostic information (i.e. comment out all writeln statements)

Exactly what Michael said. You can also enable you app to start-up in the system tray. Not showing the main form by default.

Regards,
- Graeme -

Reply by email

Noah Silva
to Graeme Geldenhuys

Hi,

As an aside, back in my Delphi developer days, I noticed that you could use the console app type to compile GUI apps just fine, but that the console window would also pop up and you could use it to output quick and dirty debug messages with writeln.

The main thing that bothered me back then was that a lot of Delphi developers came from a VB background, and even instruction books recommended you do absurd things because that's how they did it in VB. I remember one book recommending the following way to sort a list of strings:
1. Create an invisible list box on the window
2. Load it with the strings
3. Execute the sort method and then read the strings you want Using window handles and all.... no wonder VB programs often used up all of the resources in older versions of Windows.
(Note: This way was much faster than implementing sorting yourself in VB, since the listbox code was written in C and executed much faster than your VB code would if you wrote the sorting routine yourself).

Thank you,
Noah Silva

2013/7/16 Graeme Geldenhuys

Show quoted text 19 lines
On 2013-07-16 09:10, Michael Van Canneyt wrote: > > You should compile this app with $apptype GUI, and disable all diagnostic information > (i.e. comment out all writeln statements) Exactly what Michael said. You can also enable you app to start-up in the system tray. Not showing the main form by default. Regards, - Graeme - _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Graeme Geldenhuys
to Noah Silva
Noah Silva wrote
remember one book recommending the following way to sort a list of strings: 1. Create an invisible list box on the window

:-) I'm still required to maintain a VB6 program that is full of such sh*t. Hidden controls all over the place. :-/ That definitely was the way VB developers coded though.

Regards,
Graeme

Reply by email

Luciano de Souza
to Graeme Geldenhuys

I thank you for the tip. That's true I haven't tested it up to now. The Windows was damaged by 194 infections. this large amount of virus has blocked the browsers and, as a result, the web development was suspensed for some time. It's really confortable to know Linux is safier. the important is that explanations were very clear and useful. Thank you!

Graeme Geldenhuys wrote 14 lines
On 2013-07-20 12:28, Noah Silva wrote: > remember one book recommending the following way to sort a list of strings: > 1. Create an invisible list box on the window :-) I'm still required to maintain a VB6 program that is full of such sh*t. Hidden controls all over the place. :-/ That definitely was the way VB developers coded though. Regards, Graeme _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Luciano de Souza
to Graeme Geldenhuys: :-) I'm still required to maintain a VB6 program that is full of such sh*t. Hidden…

I thank you for the tip. That's true I haven't tested it up to now. The Windows was damaged by 194 infections. this large amount of virus has blocked the browsers and, as a result, the web development was suspensed for some time. It's really confortable to know Linux is safier. the important is that explanations were very clear and useful. Thank you!

Graeme Geldenhuys wrote 14 lines
On 2013-07-20 12:28, Noah Silva wrote: > remember one book recommending the following way to sort a list of strings: > 1. Create an invisible list box on the window :-) I'm still required to maintain a VB6 program that is full of such sh*t. Hidden controls all over the place. :-/ That definitely was the way VB developers coded though. Regards, Graeme _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email