隐藏窗体的任务栏按钮,而无需使用WS_EX_TOOLWIN [英] Hide a form's taskbar button without using 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.
如果我在运行时的形式转换到一个工具窗口的形式蒙皮塞住了。从网络上搜索我看到VB有ShowInTaskBar属性,我不知道这是否会做我想做的,以及它是否能在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.
推荐答案
有这个确切的问题,<一个有趣的讨论href=\"http://www.vbaccelerator.com/home/VB/$c$c/Libraries/Windows/Forcing_a_Window_to_Show_in_the_TaskBar/article.asp\">here (从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_
工具窗口被接通时,在任务栏
不显示的窗口中的按钮。
一个窗口,不应该有两个
这些扩展样式。如果窗口
不具有任一这些样式,
在任务栏上决定创建一个按钮
如果窗口是无主的,并且不
创建一个按钮,如果窗口
拥有。
"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
与GW_OWNER标志API函数
判断一个窗口是否拥有。
Incidentally, you use the GetWindow API function with the GW_OWNER flag to determine whether a window is owned.
这篇关于隐藏窗体的任务栏按钮,而无需使用WS_EX_TOOLWIN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!