请问如何自画最小化和关闭按钮?

liangml 2002-02-27 07:23:09
我想像QQ那样自画标题栏上的按钮.但
我虽然处理了WM_PAINT,WM_NCPAINT... 等好多个信息,在这些消息到来时画出自己的按钮(两个位图),但有时标题栏仍然无法显示我的按钮。请问要在非客户区作画,需要响应哪些消息呢? 谢谢!!
...全文
52 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
liangml 2002-03-13
  • 打赏
  • 举报
回复
糟糕,请问怎么给别人加分?
liangml 2002-03-13
  • 打赏
  • 举报
回复
我是用窗口DC啊.CWindowDC 只不过是封装了GetDC()和ReleaseDC()
fireseed 2002-02-27
  • 打赏
  • 举报
回复
我告诉你一个最简单的办法,你用窗口DC,CWindowDC我有源代码,需要的话与我联系creamdog@netease.com
masterz 2002-02-27
  • 打赏
  • 举报
回复
http://codeguru.earthweb.com/advancedui/CustomCaptions.shtml
Framework for Creating Custom Window Captions
http://www.codeguru.com/dialog/custom_dialog_caption.shtml
Adding Buttons to Dialog Caption
zhujianping_es 2002-02-27
  • 打赏
  • 举报
回复
In fact,the "owner-draw"you called is not implemented by owner-draw.I have had got it by button.Here is how I do it:
(1)
Make a project based on Dialog.In the dialog properties dialog,
make sure that it hasn't chose the titlebar,and the SystemMenu!
(2)
Draw a picture in the Client rect,in the picture which is drawn by yourself,there is the title bar with the min and max box .
(3)
Check the postion of the min and max box.Then you create a button
dynamically.The button should have a bitmap which is the same with
the picture.
liangml 2002-02-27
  • 打赏
  • 举报
回复
我处理了WM_NCPAINT,但还不能保证任何时候都有效。有时还是漏破绽:(
Tasehouny 2002-02-27
  • 打赏
  • 举报
回复
WM_NCPAINT,另一种是用HOOK的方法,可以在别人的窗口标题栏上画东西!

16,551

社区成员

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

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

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