I'm trying to hide the main form of my application, as I want all of the
user interaction with my application to come from interacting with a notify
icon with a context menu in the system tray (which I have working). I've
figured out how to hide the form easy enough, set the WindowState to
Minimized and ShowInTaskbar to False.

What I can't figure out is how to prevent the user Alt-Tabbing to the
window, as its still visible in the Alt-Tab menu. I can set the windows
FormBorderStyle to FixedToolWindow or SizeableToolWindow and it will no
longer show up in the Alt-Tab menu but now it will now minimize to the
bottom left of the desktop just showing the windows title bar instead of
being completely hidden!

Does anyone know of any way to completely hide a window visibly(so no part
of the window is visible anywhere), with no icon on the task bar or on the
Alt-Tab menu? All I really want is to be able to run a notify icon in the
system tray and a context menu for the icon but I'm don't know of any other
way to do it other than to run it in a enclosing form.

I've been wondering if making my application a service make things easier
but I've no experience with programming services and it seems a bit of
overkill for what I'm wanting to do!

Any advice would be most appreciated!

Cheers,

Danielb

Re: Hidding a window and preventing Alt-Tabbing to it by Sijin

Sijin
Tue Nov 30 00:07:59 CST 2004

Use Form.Hide() to hide the window rather than minimizing it.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

Danielb wrote:
> I'm trying to hide the main form of my application, as I want all of the
> user interaction with my application to come from interacting with a notify
> icon with a context menu in the system tray (which I have working). I've
> figured out how to hide the form easy enough, set the WindowState to
> Minimized and ShowInTaskbar to False.
>
> What I can't figure out is how to prevent the user Alt-Tabbing to the
> window, as its still visible in the Alt-Tab menu. I can set the windows
> FormBorderStyle to FixedToolWindow or SizeableToolWindow and it will no
> longer show up in the Alt-Tab menu but now it will now minimize to the
> bottom left of the desktop just showing the windows title bar instead of
> being completely hidden!
>
> Does anyone know of any way to completely hide a window visibly(so no part
> of the window is visible anywhere), with no icon on the task bar or on the
> Alt-Tab menu? All I really want is to be able to run a notify icon in the
> system tray and a context menu for the icon but I'm don't know of any other
> way to do it other than to run it in a enclosing form.
>
> I've been wondering if making my application a service make things easier
> but I've no experience with programming services and it seems a bit of
> overkill for what I'm wanting to do!
>
> Any advice would be most appreciated!
>
> Cheers,
>
> Danielb
>
>

Re: Hidding a window and preventing Alt-Tabbing to it by DanielB

DanielB
Tue Nov 30 02:48:50 CST 2004

I've tried calling that before and after the form's
InitializeComponent call but it does not seem to make a difference if
the border style is set to FixedToolWindow or SizeableToolWindow. You
still end up with a minimized window instead of a hidden one :-(

I guess I will need to find a new way of preventing the window showing
up in the Alt-Tab menu, as this method is proving to ackward as it
does not look like I can hide the window properally.

Daniel

On Tue, 30 Nov 2004 11:37:59 +0530, Sijin Joseph
<sijinNOSPAMdotnet@hotmail.com> wrote:

>Use Form.Hide() to hide the window rather than minimizing it.
>
>Sijin Joseph
>http://www.indiangeek.net
>http://weblogs.asp.net/sjoseph
>
>Danielb wrote:
>> I'm trying to hide the main form of my application, as I want all of the
>> user interaction with my application to come from interacting with a notify
>> icon with a context menu in the system tray (which I have working). I've
>> figured out how to hide the form easy enough, set the WindowState to
>> Minimized and ShowInTaskbar to False.
>>
>> What I can't figure out is how to prevent the user Alt-Tabbing to the
>> window, as its still visible in the Alt-Tab menu. I can set the windows
>> FormBorderStyle to FixedToolWindow or SizeableToolWindow and it will no
>> longer show up in the Alt-Tab menu but now it will now minimize to the
>> bottom left of the desktop just showing the windows title bar instead of
>> being completely hidden!
>>
>> Does anyone know of any way to completely hide a window visibly(so no part
>> of the window is visible anywhere), with no icon on the task bar or on the
>> Alt-Tab menu? All I really want is to be able to run a notify icon in the
>> system tray and a context menu for the icon but I'm don't know of any other
>> way to do it other than to run it in a enclosing form.
>>
>> I've been wondering if making my application a service make things easier
>> but I've no experience with programming services and it seems a bit of
>> overkill for what I'm wanting to do!
>>
>> Any advice would be most appreciated!
>>
>> Cheers,
>>
>> Danielb
>>
>>


Re: Hidding a window and preventing Alt-Tabbing to it by John

John
Tue Nov 30 03:57:51 CST 2004

You should be able to accomplish this by setting the form's visibility
to false at the same time that you set the form's ShowInTaskbar property
to false. Do that in your form load event handler and it should do the
trick. At least it does in VS.Net 2003 on a Win2K3 box. If this isn't
working in your current application, you may want to try creation a test
project with just that code in it and see what happens. If it works in
the test project but still doesn't in your real project then there is
likely some code somewhere that is resetting one of these values. Hope
this helps.

Have A Better One!

John M Deal, MCP
Necessity Software

DanielB wrote:
> I've tried calling that before and after the form's
> InitializeComponent call but it does not seem to make a difference if
> the border style is set to FixedToolWindow or SizeableToolWindow. You
> still end up with a minimized window instead of a hidden one :-(
>
> I guess I will need to find a new way of preventing the window showing
> up in the Alt-Tab menu, as this method is proving to ackward as it
> does not look like I can hide the window properally.
>
> Daniel
>
> On Tue, 30 Nov 2004 11:37:59 +0530, Sijin Joseph
> <sijinNOSPAMdotnet@hotmail.com> wrote:
>
>
>>Use Form.Hide() to hide the window rather than minimizing it.
>>
>>Sijin Joseph
>>http://www.indiangeek.net
>>http://weblogs.asp.net/sjoseph
>>
>>Danielb wrote:
>>
>>>I'm trying to hide the main form of my application, as I want all of the
>>>user interaction with my application to come from interacting with a notify
>>>icon with a context menu in the system tray (which I have working). I've
>>>figured out how to hide the form easy enough, set the WindowState to
>>>Minimized and ShowInTaskbar to False.
>>>
>>>What I can't figure out is how to prevent the user Alt-Tabbing to the
>>>window, as its still visible in the Alt-Tab menu. I can set the windows
>>>FormBorderStyle to FixedToolWindow or SizeableToolWindow and it will no
>>>longer show up in the Alt-Tab menu but now it will now minimize to the
>>>bottom left of the desktop just showing the windows title bar instead of
>>>being completely hidden!
>>>
>>>Does anyone know of any way to completely hide a window visibly(so no part
>>>of the window is visible anywhere), with no icon on the task bar or on the
>>>Alt-Tab menu? All I really want is to be able to run a notify icon in the
>>>system tray and a context menu for the icon but I'm don't know of any other
>>>way to do it other than to run it in a enclosing form.
>>>
>>>I've been wondering if making my application a service make things easier
>>>but I've no experience with programming services and it seems a bit of
>>>overkill for what I'm wanting to do!
>>>
>>>Any advice would be most appreciated!
>>>
>>>Cheers,
>>>
>>>Danielb
>>>
>>>
>
>

Re: Hidding a window and preventing Alt-Tabbing to it by Danielb

Danielb
Tue Nov 30 08:00:27 CST 2004

Hi John,

I've just had the applicationContext class pointed out to me so I
think I might be able to use one of these instead of a main form. As I
really don't need the main form at all, i just need something to
contain my notify icon and its context menu!

Thanks for the advice though!

Cheers,

DanielB

On Tue, 30 Nov 2004 01:57:51 -0800, John M Deal
<johndeal@necessitysoftware.com> wrote:

>You should be able to accomplish this by setting the form's visibility
>to false at the same time that you set the form's ShowInTaskbar property
> to false. Do that in your form load event handler and it should do the
>trick. At least it does in VS.Net 2003 on a Win2K3 box. If this isn't
>working in your current application, you may want to try creation a test
>project with just that code in it and see what happens. If it works in
>the test project but still doesn't in your real project then there is
>likely some code somewhere that is resetting one of these values. Hope
>this helps.
>
>Have A Better One!
>
>John M Deal, MCP
>Necessity Software
>