Howto hide a console app window and don't show it in the taskbar

  • Thread starter Thread starter klwizzard
  • Start date Start date
K

klwizzard

Hello at all,

I want to use an console application as an host.
In one other component I want to implement an tray Icon.
For this case I want to hide the consoleapp window after starting dthe
application.
Also I don't want that console app window will shown in the taskbar.

Here are my questions:
1. : How can I find a sample or further information about hiding the window
after application start?
2. : How can I find a sample or further information about to avoid that the
console app window will shohn in the task bar?

Thanks for your time and your help.

Best regards
Detlev
 
Just don't build it as a console exe; build it as a windows exe and
there will be no console.
The console is an OS-level flag in the PE header; disabling it at
runtime is tricky at best...

Marc
 
Hello Marc,

thanks a lot for your fast help.
I' afraid that this will simpliest the solution for my problem.
I will take this way for my solution.
I'm not a experianced framework developer, what means the PE header?

Best regards
Detlev
 
PE means Portable Executable; it is the file format that windows "exe"
files use (and in fact "dll"s too).

At the start of this file is the header, which has some flags to tell
the OS what to do with it. One of these flags indicates whether that
process will need a console.

So basically - when you compile, it sets this flag depending on whether
you have chosen your project as a windows exe or a console exe. Just
change it to a windows exe.

Marc
 
Hello Marc,

thanks a lot for your fast and detailed help.
I will later more learn about PE and the using of it.

Best regrads
Detlev
 
Hello Mike,

many thanks for the snippet.
Sorry for my late answer, I've checked this thread not for a while.

Best regards
Detlev
 
Back
Top