Hide main Form

A

AliR \(VC++ MVP\)

Hi All,

I have a C# application which talks to some hardware on the machine. The
application puts a NofityIcon in the taskbar, and needs to be hidden.
In order to hide the main form I'm calling SetTopLevel(false) in the Load
event handler of the form, but when I do that I no longer receive
broadcasted registered window messages.
I've also tried ShowInTaskBar = false; and hiding the form, but setting
ShowInTaskBar to false has the same negative effect.

Does anyone know of a way to hide my main form, and still receive
broadcasted windows messages?

Thanks
AliR.
 
J

joecool1969

Hi All,

I have a C# application which talks to some hardware on the machine.  The
application puts a NofityIcon in the taskbar, and needs to be hidden.
In order to hide the main form I'm calling SetTopLevel(false) in the Load
event handler of the form, but when I do that I no longer receive
broadcasted registered window messages.
I've also tried ShowInTaskBar = false; and hiding the form, but setting
ShowInTaskBar to false has the same negative effect.

Does anyone know of a way to hide my main form, and still receive
broadcasted windows messages?

Thanks
AliR.

I wrote a really simple tray app, and the only thing I did was set the
form's WindowState property in design mode to Minimized. I also have
ShowInTaskbar set to false.
 
M

Mel Weaver

Set the form's Opacity to 0%


Hi All,

I have a C# application which talks to some hardware on the machine. The
application puts a NofityIcon in the taskbar, and needs to be hidden.
In order to hide the main form I'm calling SetTopLevel(false) in the Load
event handler of the form, but when I do that I no longer receive
broadcasted registered window messages.
I've also tried ShowInTaskBar = false; and hiding the form, but setting
ShowInTaskBar to false has the same negative effect.

Does anyone know of a way to hide my main form, and still receive
broadcasted windows messages?

Thanks
AliR.

I wrote a really simple tray app, and the only thing I did was set the
form's WindowState property in design mode to Minimized. I also have
ShowInTaskbar set to false.
 
A

AliR \(VC++ MVP\)

Although that will hide the form, it will not remove its icon from the
taskbar, I think that would be awkward to have a hidden window that shows up
in the taskbar. The problem is that once I remove it from the taskbar using
either SetTopLevel(false) or ShowInTaskbar = false, it stops receiving
broadcasted registered windows messages.

AliR.
 
A

AliR \(VC++ MVP\)

The best thing I have come up with so far is to start the form minimized,
create timer in the form's constructor, and in the timer event hide the
form.

This flashes the icon in the taskbar for a split second, not very
professional if you ask me! (But at least I get broadcasted windows
messages). I wish there was a good solution for this in .Net!

I'm having a hard time believing that you cannot have tray app with an
initial hidden dialog. None of the native tray apps flash in the taskbar as
they start.

Does anyone have a solution for this?

AliR.
 

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

Top