【发布时间】:2011-03-16 16:51:09
【问题描述】:
相信我,我在 Google 上搜索过它,并认为它会很容易找到 - 但事实并非如此。 我有我的窗把手,但没有表格。我该怎么做? 谢谢!
【问题讨论】:
标签: c# .net winapi window taskbar
相信我,我在 Google 上搜索过它,并认为它会很容易找到 - 但事实并非如此。 我有我的窗把手,但没有表格。我该怎么做? 谢谢!
【问题讨论】:
标签: c# .net winapi window taskbar
将 Form 的 ShowInTaskbar 属性设置为 false。
【讨论】:
声明这些:
[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);
(将句柄更改为您存储的窗口句柄)
【讨论】: