怎样让程序不在任务条上显示?

peasant 2000-01-26 12:20:00
在系统盒中添加了图标后,用ShowWindow(hwnd,SW_HIDE)隐藏任务栏上的图标
却无效,怎样让程序不在任务条上显示?
...全文
275 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dengdun 2000-03-01
  • 打赏
  • 举报
回复
peasant,你的问题解决了吗?我也遇到了同样的问题,也一直无法解决。如果解决了能告诉我解决方法吗。
peasant 2000-01-31
  • 打赏
  • 举报
回复
cowherds,
SetWindowLong函数的详细介绍
LONG SetWindowLong(

HWND hWnd, // handle of window
int nIndex, // offset of value to set
LONG dwNewLong // new value
);


Parameters

hWnd

Identifies the window and, indirectly, the class to which the window belongs.

nIndex

Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus 4; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To set any other value, specify one of the following values:

Value Action
GWL_EXSTYLE Sets a new extended window style.
GWL_STYLE Sets a new window style.
GWL_WNDPROC Sets a new address for the window procedure.
GWL_HINSTANCE Sets a new application instance handle.
GWL_ID Sets a new identifier of the window.
GWL_USERDATA Sets the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.


The following values are also available when the hWnd parameter identifies a dialog box:

Value Action
DWL_DLGPROC Sets the new address of the dialog box procedure.
DWL_MSGRESULT Sets the return value of a message processed in the dialog box procedure.
DWL_USER Sets new extra information that is private to the application, such as handles or pointers.


dwNewLong

Specifies the replacement value.



yb 2000-01-30
  • 打赏
  • 举报
回复
有关GetWindowLong和SetWindowLong的使用,有MSDN的话就一切搞定。
cowherds 2000-01-28
  • 打赏
  • 举报
回复
把修改主窗口的扩展属性的方法我已试了,可是只适用于MainFrame文档/视图程序,基于对话框的程序没有用,请问如何使对话框程序不在任务条上显示。
另外请问zyb如何使用SetWindowLong函数,有没有API函数的详细介绍。
lange 2000-01-26
  • 打赏
  • 举报
回复

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.dwExStyle and =WS_EX_TOOLWINDOW;//不显示任务按钮
return TRUE;
}
xubin_sh 2000-01-26
  • 打赏
  • 举报
回复
The rules the taskbar uses to decide whether a button should be shown for a window are really quite simple, but are not well documented. When you create a window, the taskbar examines the window’s extended style to see if either the WS_EX_APPWINDOW (defined as 0x00040000) or WS_EX_TOOLWINDOW (defined as 0x00000080) 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. You should never create a window that has both of these extended styles.

You can create a window that doesn’t have either of these styles. If a window has neither style, the taskbar decides to create a button if the window is unowned and does not create a button if the window is owned.

One final note: before making any of the above tests, the taskbar first checks to see if a window has the standard WS_VISIBLE window style turned on. If this style bit is off, the window is hidden; the taskbar never shows a button for a hidden window. Only if the WS_VISIBLE style bit is on will the taskbar check the WS_EX_APPWINDOW, WS_ EX_TOOLWINDOW, and window ownership information.u
zyb 2000-01-26
  • 打赏
  • 举报
回复
利用API函数SetWindowLong(HWND hWnd,int nIndex,Long dwNewLong)可以实现使应用程序不出现在任务栏中。
光明山人 2000-01-26
  • 打赏
  • 举报
回复
将你的主窗口的扩展属性设为:WS_EX_TOOLWINDOW;

16,466

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧