Exclude app from displaying in the Alt-Tab window

D

Dale

I'm using the NotifyIcon component on a form within a Windows application
that will normally show no interface.
NotifyIcon does add an icon as required to the notification area of the Task
Bar. Unfortunately the window is showing up in the little window that is
displayed when user uses Alt-Tab to switch applications.

How do I make this application not show up in the Alt-Tab window?

Thanks.

Dale
 
J

Joakim Karlsson

Set the form's ShowInTaskbar property to false, and set the
FormBorderStyle property to either FixedToolWindow or SizableToolWindow.

Regards,
Joakim
 
D

Dale

Thanks for the info Joakim.

Your suggestion doesn't completely solve the problem, but comes pretty
close. Thank you for the help.

In case anyone else has this problem, I've included my documentation below.
Please let me know if you have a simple suggestion for getting rid of the
last case. Thanks.

/// In order to make the window invisible, you need to do a few things.
/// To prevent window from normally showing in Task bar or in the Alt-Tab
window used
/// to select the foreground application:
/// - set ShowInTaskbar property to false
/// - set FormBorderStyle property to either FixedToolWindow or
SizableToolWindow
///
/// To prevent the window itself from being visible, setting WindowState to
minimized
/// does not work, due to the FormBorderStyle setting from above. You need
to:
/// - set StartPosition to Manual
/// - set Location to something off the screen, such as 2500,0
/// - set WindowState to Normal
///
/// You will still be able to see this window in the Alt-Tab window if:
/// - no window has focus (e.g. user has clicked on the task bar on a
NotifyIcon
/// therein)
/// - the NotifyIcon for this window was right-clicked
/// This seems to be standard Windows behaviour (or a consistent Windows
bug),
/// as right-clicking on any icon in the notification area of the task bar
temporarily
/// adds it to the Alt-Tab window. Left-clicking does not.
/// In my particular case, I was clicking on the NotifyIcon for this app in
the
/// task bar, and using the ContextMenu to launch a new form/window which
was used
/// to display a message. Immediately pressing Alt-Tab caused both the new
window
/// and the original "invisible" window to be listed. Clicking either the
new
/// window or any other application caused this "invisible" window to no
longer be
/// listed.
/// Getting the application that previously had focus and returning focus to
it
/// would likely resolve this.


Dale
 

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