从表单标题栏中的关闭,最小化和最大化/恢复按钮中删除工具提示 [英] Remove tooltip from the close, minimize and maximize/restore button in title bar of the form

查看:71
本文介绍了从表单标题栏中的关闭,最小化和最大化/恢复按钮中删除工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我需要从表单标题栏中的控制按钮(关闭,最小化,最大化/恢复按钮)中删除工具提示。

I need to remove the tool tip from the control buttons(close, minimize, maximize/restore buttons) in the title bar of a form.


Is有可能吗?如果可能的话我该怎么做?

Is it possible? If possible how can I do that?


请分享您宝贵的建议。

Please share your valuable suggestions.


提前致谢。

Thanks in advance.

推荐答案

标题栏按钮不是实际按钮。它们是WM_NCPAINT系统处理的结果。要在标题栏上获取鼠标单击消息,您需要调用SetCapture,然后当鼠标位置
在这些按钮上时,您可以将消息转发到您自己的工具提示控件(自己发送WM_NCHITTEST以验证)。 SetCapture搞砸了很多东西,例如,你将不再接收WM_NCMOUSEMOVE并获得WM_MOUSEMOVE,现在你需要自己发送WM_SYSCOMMAND来控制
按钮,因为你正在跳过默认值鼠标在这些按钮上的窗口过程。 

the title bar buttons are not actual buttons. they are the result of system handling of WM_NCPAINT. To get mouse click messages on the title bar you need to call SetCapture, then you can relay the messages to your own tooltip control when the mouse position is on those buttons (send WM_NCHITTEST yourself to verify that). SetCapture messes up a lot of things, e.g. you will no longer receive WM_NCMOUSEMOVE and get WM_MOUSEMOVE instead, and now you need to send WM_SYSCOMMAND yourself for those control buttons when they are clicked, since you are skipping the default window procedure when mouse is on those buttons. 

在Vista +上你也可以
将您的客户区扩展到标题栏
,您可以自己绘制这些按钮(您需要处理标题等正常任务)栏拖动,系统按钮点击等)。

On Vista+ you can also extend your client area to the title bar, and you can draw those buttons yourself (you need to handle the normal tasks like title bar dragging, system button click etc).

无论哪种方式,你需要很多pinvoke。 

Either way, you need a lot of pinvoke. 


这篇关于从表单标题栏中的关闭,最小化和最大化/恢复按钮中删除工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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