Hide main Form

  • Thread starter Thread starter AliR \(VC++ MVP\)
  • Start date Start date
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.
 
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.
 
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.
 
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.
 
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.
 
Back
Top