Hi,
I'm writing a program that basically just sits on the desktop in a borderless form. I have everything working as I'd like, except for the 'alt-tab' function of windows. Does anyone know of a way to remove a form from the 'alt-tab' list of programs?
Thanks
Loading
David ThielkePosted Dec 12, 2007, 1:09 AM
AlanPosted Dec 11, 2007, 3:59 PM
I'd have thought that setting the Form's ShowInTaskbar property to false would remove it from the Alt-Tab list as well ?
However, if it doesn't, then try these Win32 calls:
using System.Runtime.InteropServices;
........
[DllImport("user32.dll")]
static extern int GetWindowLong( IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
static extern int SetWindowLong( IntPtr hWnd, int nIndex, int
dwNewLong);
const int GWL_EXSTYLE = -20;
const int WS_EX_TOOLWINDOW = 0x80;
.......
IntPtr hWnd = this.Handle;
int dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, dwExStyle | WS_EX_TOOLWINDOW);