2010-07-15 88 views

回答

5

聲明這些:

[DllImport("user32.dll", SetLastError = true)] 
static extern int GetWindowLong(IntPtr hWnd, int nIndex); 
[DllImport("user32.dll")] 
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); 
private const int GWL_EX_STYLE = -20; 
private const int WS_EX_APPWINDOW = 0x00040000, WS_EX_TOOLWINDOW = 0x00000080; 

然後表單前使用此所示:


SetWindowLong(handle, GWL_EX_STYLE, (GetWindowLong(handle, GWL_EX_STYLE) | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW); 

(其他城市句柄無論你的窗口句柄存儲在)

+0

只有在SetWindowLong()調用後最小化窗體時才能使用。我想知道爲什麼... – sjlewis 2012-04-18 09:02:05

2

設置窗體的ShowInTaskbar財產虛假。

+0

與WinAPI,而不是.NET屬性。 – Lazlo 2012-03-27 16:41:25

+0

相當有用的迴應 – geogeek 2012-08-01 00:38:45