How do I hide a program from ALT-TAB.

G

Guest

Hello,

I want to develop an app that is accessed via a notify icon. I don't want to show a user interface. I hide the form programatically, but I still see it when I push alt tab.

Is there a setting that will allow me to hide my app from alt tab?
 
J

Jason Newell

Marc,
This is an excerpt from MSDN.

TaskVisible Property Changes in Visual Basic .NET See Also App Object
Changes in Visual Basic .NET

In Visual Basic 6.0, the TaskVisible property of the App object determined
whether an application appeared in the Windows task list (Windows 9x) or in
the Task Manager Applications tab (Windows 2000). The property was commonly
used to prevent a user from closing an application that was intended to run
as a background task; in most cases it was used with applications that did
not display a user interface.

In Visual Basic .NET, there is no equivalent for the TaskVisible property;
however, you can create a Windows Service or a Console Application that will
not show up in the task list.


I tried the following and it seemed to work for me.

private void InitializeComponent()
{
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
this.ShowInTaskbar = false;
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);

// Added the following lines.
this.WindowState = FormWindowState.Minimized;
this.Visible = false;
this.Hide();
}

HTH

--
Jason Newell
Software Engineer
The Charles Machine Works, Inc.


Marc said:
Hello,

I want to develop an app that is accessed via a notify icon. I don't
want to show a user interface. I hide the form programatically, but I still
see it when I push alt tab.
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Mark,

Set Form's FormBorderStyle to either FormBorderStyle.SizableToolWindow or
FormBorderStyle.FixedToolWindow

--
HTH
B\rgds
100 [C# MVP]

Marc said:
Hello,

I want to develop an app that is accessed via a notify icon. I don't
want to show a user interface. I hide the form programatically, but I still
see it when I push alt tab.
 
P

pcavit

If you do that, the form minimizes to the bottom-left of the screen and
the titlebar remains there, despite any settings you may have
otherwise.

Any other ideas?
Stoitcho said:
Hi Mark,

Set Form's FormBorderStyle to either
FormBorderStyle.SizableToolWindow or
FormBorderStyle.FixedToolWindow

--
HTH
B\rgds
100 [C# MVP]

Marc said:
Hello,

I want to develop an app that is accessed via a notify icon. I
don't
want to show a user interface. I hide the form programatically, but I still
see it when I push alt tab.
Is there a setting that will allow me to hide my app from alt tab?
 

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