文件名称:WINSHOW
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:99.37kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
用 Win API 实现自绘按钮类
用过MFC自绘按钮的人都知道,是通过重载了父窗口WM_DRAWITEM的响应消息实现的。同时也要子类化按钮来得到按钮的其他有用的消息,比如WM_MOUSEMOVE、WM_KEYDOWN等消息。因为MFC的消息循环都是封装好的,所以只要派生一下基本控件类就可以了。当是用WIN32API做的话就需要自己来子类化按钮窗口的消息循环了,相信经常编程的朋友都知道,子类化控件要用到SetWindowLong来改变窗口的回调过程,然后在回调窗口内添上自己需要处理的消息即可。因为我们要实现自绘按钮所以最好把子类化的过程做成一个类,然后传给它要自绘的按钮句柄就行了。因为要在类里面实现消息回调函数,但是类里面的消息回调函数只能是静态的,所以不能对应每个实例的消息回调。在我实现的按钮子类化类里,我用到Thunk技术或SetProp函数来实现的
用过MFC自绘按钮的人都知道,是通过重载了父窗口WM_DRAWITEM的响应消息实现的。同时也要子类化按钮来得到按钮的其他有用的消息,比如WM_MOUSEMOVE、WM_KEYDOWN等消息。因为MFC的消息循环都是封装好的,所以只要派生一下基本控件类就可以了。当是用WIN32API做的话就需要自己来子类化按钮窗口的消息循环了,相信经常编程的朋友都知道,子类化控件要用到SetWindowLong来改变窗口的回调过程,然后在回调窗口内添上自己需要处理的消息即可。因为我们要实现自绘按钮所以最好把子类化的过程做成一个类,然后传给它要自绘的按钮句柄就行了。因为要在类里面实现消息回调函数,但是类里面的消息回调函数只能是静态的,所以不能对应每个实例的消息回调。在我实现的按钮子类化类里,我用到Thunk技术或SetProp函数来实现的
(系统自动生成,下载前可以参看下载内容)
下载文件列表
WINSHOW/1.bmp
WINSHOW/al_ok.bmp
WINSHOW/ba320-240.bmp
WINSHOW/back.bmp
WINSHOW/bitmap1.bmp
WINSHOW/bitmap2.bmp
WINSHOW/bitmap5.bmp
WINSHOW/CWINBUTTON/CWINBUTTON.cpp
WINSHOW/CWINBUTTON/CWINBUTTON.dep
WINSHOW/CWINBUTTON/CWINBUTTON.dsp
WINSHOW/CWINBUTTON/CWINBUTTON.mak
WINSHOW/CWINBUTTON/MYBUTTON.cpp
WINSHOW/CWINBUTTON/MYBUTTON.h
WINSHOW/CWINBUTTON/ReadMe.txt
WINSHOW/CWINBUTTON/StdAfx.cpp
WINSHOW/CWINBUTTON/StdAfx.h
WINSHOW/CWINBUTTON/SubClass.cpp
WINSHOW/CWINBUTTON/SubClass.h
WINSHOW/CWINBUTTON/WINButton.cpp
WINSHOW/CWINBUTTON/WINButton.h
WINSHOW/Disable.bmp
WINSHOW/DLG/DLG.cpp
WINSHOW/DLG/DLG.dep
WINSHOW/DLG/DLG.dsp
WINSHOW/DLG/DLG.h
WINSHOW/DLG/DLG.mak
WINSHOW/DLG/DLG.rc
WINSHOW/DLG/DLGDlg.cpp
WINSHOW/DLG/DLGDlg.h
WINSHOW/DLG/ReadMe.txt
WINSHOW/DLG/res/bitmap1.bmp
WINSHOW/DLG/res/DLG.ico
WINSHOW/DLG/res/DLG.rc2
WINSHOW/DLG/Resource.h
WINSHOW/DLG/StdAfx.cpp
WINSHOW/DLG/StdAfx.h
WINSHOW/hove.bmp
WINSHOW/press.bmp
WINSHOW/ReadMe.txt
WINSHOW/resource.h
WINSHOW/small.ico
WINSHOW/StdAfx.cpp
WINSHOW/StdAfx.h
WINSHOW/Thumbs.db
WINSHOW/toolbar1.bmp
WINSHOW/WINBUTTON_EXPORT.H
WINSHOW/WINSHOW.cpp
WINSHOW/WINSHOW.dep
WINSHOW/WINSHOW.dsp
WINSHOW/WINSHOW.dsw
WINSHOW/WINSHOW.h
WINSHOW/WINSHOW.ico
WINSHOW/WINSHOW.mak
WINSHOW/WINSHOW.rc
WINSHOW/DLG/res
WINSHOW/CWINBUTTON
WINSHOW/DLG
WINSHOW
www.dssz.com.txt
WINSHOW/al_ok.bmp
WINSHOW/ba320-240.bmp
WINSHOW/back.bmp
WINSHOW/bitmap1.bmp
WINSHOW/bitmap2.bmp
WINSHOW/bitmap5.bmp
WINSHOW/CWINBUTTON/CWINBUTTON.cpp
WINSHOW/CWINBUTTON/CWINBUTTON.dep
WINSHOW/CWINBUTTON/CWINBUTTON.dsp
WINSHOW/CWINBUTTON/CWINBUTTON.mak
WINSHOW/CWINBUTTON/MYBUTTON.cpp
WINSHOW/CWINBUTTON/MYBUTTON.h
WINSHOW/CWINBUTTON/ReadMe.txt
WINSHOW/CWINBUTTON/StdAfx.cpp
WINSHOW/CWINBUTTON/StdAfx.h
WINSHOW/CWINBUTTON/SubClass.cpp
WINSHOW/CWINBUTTON/SubClass.h
WINSHOW/CWINBUTTON/WINButton.cpp
WINSHOW/CWINBUTTON/WINButton.h
WINSHOW/Disable.bmp
WINSHOW/DLG/DLG.cpp
WINSHOW/DLG/DLG.dep
WINSHOW/DLG/DLG.dsp
WINSHOW/DLG/DLG.h
WINSHOW/DLG/DLG.mak
WINSHOW/DLG/DLG.rc
WINSHOW/DLG/DLGDlg.cpp
WINSHOW/DLG/DLGDlg.h
WINSHOW/DLG/ReadMe.txt
WINSHOW/DLG/res/bitmap1.bmp
WINSHOW/DLG/res/DLG.ico
WINSHOW/DLG/res/DLG.rc2
WINSHOW/DLG/Resource.h
WINSHOW/DLG/StdAfx.cpp
WINSHOW/DLG/StdAfx.h
WINSHOW/hove.bmp
WINSHOW/press.bmp
WINSHOW/ReadMe.txt
WINSHOW/resource.h
WINSHOW/small.ico
WINSHOW/StdAfx.cpp
WINSHOW/StdAfx.h
WINSHOW/Thumbs.db
WINSHOW/toolbar1.bmp
WINSHOW/WINBUTTON_EXPORT.H
WINSHOW/WINSHOW.cpp
WINSHOW/WINSHOW.dep
WINSHOW/WINSHOW.dsp
WINSHOW/WINSHOW.dsw
WINSHOW/WINSHOW.h
WINSHOW/WINSHOW.ico
WINSHOW/WINSHOW.mak
WINSHOW/WINSHOW.rc
WINSHOW/DLG/res
WINSHOW/CWINBUTTON
WINSHOW/DLG
WINSHOW
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.