隐藏窗体的任务栏按钮,而不使用WS_EX_TOOLWIN [英] Hide a form's taskbar button without using WS_EX_TOOLWIN

查看:159
本文介绍了隐藏窗体的任务栏按钮,而不使用WS_EX_TOOLWIN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从任务栏中隐藏Windows窗体,但不能使用 WS_EX_TOOLWINDOW ,因为我需要窗体标题栏上的系统菜单和最小/最大值按钮。

I need to hide a Windows form from the taskbar but I can't use WS_EX_TOOLWINDOW because I need the system menu and min/max buttons on the form's title bar.

如果在运行时将窗体切换到工具窗口,则将填充表单。从Web上搜索我看到VB有一个ShowInTaskbar属性,我想知道这是否会做我想要的,以及是否可以在Delphi 2006中实现。此项目是一个COM服务器,没有MainForm等。

If I switch the form to a tool window at runtime the form skinning is stuffed up. From searching on the Web I see that VB has a ShowInTaskbar property and I'm wondering if this would do what I want, and whether it can be implemented in Delphi 2006. Also this project is a COM server and has no MainForm, etc.

推荐答案

有一个有趣的讨论这个确切的问题这里(来自VB6 persepective)。

There's an interesting discussion of this exact problem here (from a VB6 persepective).

最相关从您的问题的角度来看,有一点是:

The most relevant bit from your question's perspective is:


创建窗口时,任务栏
会检查窗口的扩展样式
查看是否打开WS_EX_APPWINDOW
(& H40000)或WS_EX_TOOLWINDOW(& H80)
样式,如果WS_EX_APPWINDOW
已打开,则任务栏显示
按钮,如果WS_EX_
TOOLWINDOW已打开,则任务栏
将执行n ot显示窗口的按钮。
一个窗口不应该有这两个扩展样式的
。如果窗口
没有这些样式,
任务栏决定创建一个按钮
如果窗口不存在,并且
创建一个按钮如果窗口是
拥有。

"When you create a window, the taskbar examines the window's extended style to see if either the WS_EX_APPWINDOW (&H40000) or WS_EX_TOOLWINDOW (&H80) style is turned on. If WS_EX_APPWINDOW is turned on, the taskbar shows a button for the window, and if WS_EX_ TOOLWINDOW is turned on, the taskbar does not show a button for the window. A window should never have both of these extended styles. If the window doesn't have either of these styles, the taskbar decides to create a button if the window is unowned and does not create a button if the window is owned."

顺便说一下,您使用GetWindow
API函数,GW_OWNER标志为
确定窗口是否拥有。

Incidentally, you use the GetWindow API function with the GW_OWNER flag to determine whether a window is owned.

这篇关于隐藏窗体的任务栏按钮,而不使用WS_EX_TOOLWIN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆