C# 以编程方式禁用任务栏功能

发布于 2024-09-13 01:24:26 字数 206 浏览 9 评论 0原文

当您打开 Internet Explorer 或 Mozilla 时,任务栏中会弹出一个新任务。

当您右键单击此任务栏项目时,它会显示

“恢复”、“移动”、“大小”、“最小化”、“最大化”、“关闭”。

现在我有一个不使用大小、最小化、最大化或关闭的应用程序。

有人可以给我快速引导或提醒以禁用它们吗?

提前致谢 -凯文

When you open internet explorer or mozilla, a new task in the task bar pops out.

When you right click this taskbar item it saids

Restore, move, size, minimize, maximize, close.

Now i have an application that does not use size, minimize,maximize or close.

Can someone give me a quick lead or heads up in order to disable them?

Thanks in advance
-Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆梦 2024-09-20 01:24:26

您可以使用 SetWindowLong 函数 (http://msdn. microsoft.com/en-us/library/ms633591(VS.85).aspx)。

[DllImport("user32.dll", SetLastError = true)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

int GwlStyle = -16;       // GWL_STYLE 
int WsSysMenu = 0x80000;  // WS_POPUP

var hwnd = new WindowInteropHelper(this).Handle;
SetWindowLong(hwnd, GwlStyle, GetWindowLong(hwnd, GwlStyle) & ~WsSysMenu);

检查上面的链接以获取有关 GwlStyle 和 WsSysMenu 的值所表示含义的更多信息。这会将窗口设置为弹出窗口。但是,这也会删除右上角的关闭、最大化和最小化按钮。

You can use the SetWindowLong function (http://msdn.microsoft.com/en-us/library/ms633591(VS.85).aspx).

[DllImport("user32.dll", SetLastError = true)]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

int GwlStyle = -16;       // GWL_STYLE 
int WsSysMenu = 0x80000;  // WS_POPUP

var hwnd = new WindowInteropHelper(this).Handle;
SetWindowLong(hwnd, GwlStyle, GetWindowLong(hwnd, GwlStyle) & ~WsSysMenu);

Check the above link for more information about what the values of GwlStyle and WsSysMenu indicate. This will style the window to be a popup window. However, this also removes the close, maximize, and minimize buttons from the top-right.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文