Display a form without showing in alt-tab

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am tring to display a form that does not show in either the task bar or
when the user alt-tabs. The form is running full screen and is set to have no
border.

Nick
 
Hi
you have property ShownInTaskBar,set that propert to false.the form won't
seen in the task bar.
guy
 
I've done that already - it doesn't show in the task bar, but it still shows
when you alt-tab. Any other ideas?
 
Hi Nick,

I use the code below to do a similar thing, I use a NotifyIcon and
therefore remove the form fmro the taskbar, alt+tab , etc. I do so
P/Invoking

These are the dclarations:
const int GWL_EXSTYLE = -20;
const int WS_EX_TOOLWINDOW = 0x00000080;
const int WS_EX_APPWINDOW = 0x00040000;


[DllImport("user32.dll")]
public static extern int SetWindowLong( IntPtr window, int index, int
value);
[DllImport("user32.dll")]
public static extern int GetWindowLong( IntPtr window, int index);

This is the code:
//Remove from the taskbar and also from alt+tab
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
this.Visible = false;
this.ShowInTaskbar = false;

int windowStyle = GetWindowLong(Handle, GWL_EXSTYLE);
SetWindowLong(Handle, GWL_EXSTYLE, windowStyle | WS_EX_TOOLWINDOW);


Cheers,
 
Back
Top