klwizzard
6/13/2008 1:00:00 PM
Hello Mike,
many thanks for the snippet.
Sorry for my late answer, I've checked this thread not for a while.
Best regards
Detlev
"Michael D. Ober" <obermd.@.alum.mit.edu.nospam.> schrieb im Newsbeitrag
news:F4mdnQPF698obNDVnZ2dnUVZ_oHinZ2d@earthlink.com...
> "klwizzard" <klwizzard@gmx.de> wrote in message
> news:uhN$gvjyIHA.5472@TK2MSFTNGP06.phx.gbl...
>> 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
>
> Here's the code in VB
>
> ' Windows API to minimize the console window after initialization
> Private Declare Function GetConsoleWindow Lib "kernel32.dll" () As IntPtr
> Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As
> IntPtr, ByVal nCmdShow As Int32) As Int32
> Private Const SW_SHOWMINNOACTIVE As Int32 = 7
> Private Const SW_SHOWNORMAL As Int32 = 1
> Private Const SW_HIDE as Int32 = 0
>
> ' In the code
> ShowWindow(GetConsoleWindow(), SW_HIDE)
>
> Mike.
>
>