Program without window

C

CProgrammer331

A very silly question which I never could answer to:
How to create a simple Win32 program that doesn't show any window
(neither minimized)
the easiest way?
 
G

Gianni Mariani

A very silly question which I never could answer to:
How to create a simple Win32 program that doesn't show any window
(neither minimized)
the easiest way?

This is windows specific and hence a platform specific question.

On most systems (other than windows), you have to specifically
initialize the window to display a window. In win32, you have to
compile it differently and I think the entry point is not main, it's
somthing else, I can't remember at the moment.
 
J

jacob navia

A very silly question which I never could answer to:
How to create a simple Win32 program that doesn't show any window
(neither minimized)
the easiest way?

In C:

#include <stdio.h>

int main(void)
{
printf("This is a program that doesn't display any window\n");
}
 
V

Victor Bazarov

jacob said:
In C:

#include <stdio.h>

int main(void)
{
printf("This is a program that doesn't display any window\n");
}

In C? Looks like a C++ program to me...

V
 
G

gpriv

int main(void)
{
printf("This is a program that doesn't display any window\n"); return 0; // return missing

}

This program will run in console window (or create one if lunched
directly). There are many ways to do windowless programs. You may
run it as service or have main window hidden, or show as an icon on
launchpad. Really should go to Windows API forum.

George
 
J

jacob navia

This program will run in console window (or create one if lunched
directly). There are many ways to do windowless programs. You may
run it as service or have main window hidden, or show as an icon on
launchpad. Really should go to Windows API forum.

George

It will not create any console window if you compile it as a windows
program.

If it is launched from an existing console window it will show the
message, if it is launched from the desktop you will not see anything.
 
G

Gianni Mariani

jacob said:
It will not create any console window if you compile it as a windows
program.

If it is launched from an existing console window it will show the
message, if it is launched from the desktop you will not see anything.

It will create a window depending on how it is launched and how it is
compiled.
 
V

Victor Bazarov

Gianni said:
It will create a window depending on how it is launched and how it is
compiled.

I believe it's the system that creates a window to run a program built
for "console" subsystem, not the program itself.

And why are we talking about it?

V
 
J

jacob navia

Victor said:
I believe it's the system that creates a window to run a program built
for "console" subsystem, not the program itself.

And why are we talking about it?

I do not know :)

But now that you are around, why is my example program C++ and NOT
just plain C?

It doesn't use any specific C++ constructs
 
V

Victor Bazarov

jacob said:
I do not know :)

But now that you are around, why is my example program C++ and NOT
just plain C?

It doesn't use any specific C++ constructs

I didn't say it was *not* "just plain C". It is a valid program in
both languages. But why in hell would you want to post a C program
here?

V
 
J

jacob navia

Victor said:
I didn't say it was *not* "just plain C". It is a valid program in
both languages. But why in hell would you want to post a C program
here?

V

I apologize for my heresy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,516
Latest member
TobiasAxf

Latest Threads

Top