SlideShare a Scribd company logo
1 of 12
Download to read offline
深入 windows 窗口和消息

         刘鹏
目录
•   从一个简单的程序开始
•   窗口类的分析
•   窗口样式分析
•   理解窗口过程
•   重要的窗口消息的分析
•   探究消息之间的关联
从简单开始
• 使用 vs2005 生成向导
• 整个程序的结构
窗口类的分析
•   为什么需要窗口类
•   窗口类的分类
•   窗口类样式详细分析
•   窗口类的其他成员
•   窗口过程
窗口类样式详细分析
• RegisterClass 函数
• CS_HREDRAW 与 CS_VREDRAW
• CS_PARENTDC , CS_OWNDC , CS_C
  LASSDC
• CS_DBLCLKS
• CS_GLOBALCLASS
窗口样式分析
•   WS_OVERLAPPED
•   WS_CAPTION
•   WS_SYSMENU
•   WS_MINIMIZEBOX
•   WS_MAXIMIZEBOX
•   WS_POPUP
•   WS_BORDER
•   WS_SYSMENU
•   WS_CHILD
窗口扩展属性
•   WS_EX_TOPMOST
•   WS_EX_MDICHILD
•   WS_EX_TOOLWINDOW
•   WS_EX_CLIENTEDGE
•   WS_EX_ACCEPTFILES
窗口过程
•   窗口行为的实现接口
•   子类化与超类化
•   窗口过程是重入的
•   尽快完成你要干的活
•   不要干的事情
•   普通窗口过程与 Dialog 的过程比较
重要的窗口消息( 1 )
•   WM_CREATE
•   WM_CLOSE
•   WM_DESTROY
•   WM_QUIT
•   WM_MOVE 、 WM_MOVING
•   WM_SIZE 、 WM_SIZING
•   WM_ERASEBKGND
•   WM_PAINT
重要的窗口消息( 2 )
•   WM_MOUSEMOVE
•   WM_LBUTTONDOWN
•   WM_LBUTTONUP
•   WM_LBUTTONDBLCLK
•   WM_RBUTTONDOWN
•   WM_RBUTTONUP
•   WM_RBUTTONDBLCLK
•   WM_MOUSEWHEEL
•   WM_MOUSEHOVER
•   WM_MOUSELEAVE
重要的窗口消息( 3 )
•   WM_CHAR
•   WM_KEYDOWN
•   WM_KEYUP
•   WM_TIME
•   WM_NCCREATE
•   WM_NCCALCSIZE
•   WM_NCHITTEST
•   ...
探究消息之间的关联
• 窗口消息打印类

More Related Content

More from Zoom Quiet

产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变Zoom Quiet
 
01s0401 go,互联网时代的c语言 许式伟
01s0401 go,互联网时代的c语言   许式伟01s0401 go,互联网时代的c语言   许式伟
01s0401 go,互联网时代的c语言 许式伟Zoom Quiet
 
Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoom Quiet
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1Zoom Quiet
 
Zh120226techparty zd-story
Zh120226techparty zd-storyZh120226techparty zd-story
Zh120226techparty zd-storyZoom Quiet
 
Zh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZoom Quiet
 
Zh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZoom Quiet
 
Velocity2011分享
Velocity2011分享Velocity2011分享
Velocity2011分享Zoom Quiet
 
陈正 Introduction to-sae_python
陈正   Introduction to-sae_python陈正   Introduction to-sae_python
陈正 Introduction to-sae_pythonZoom Quiet
 
111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿Zoom Quiet
 
111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析Zoom Quiet
 
111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发Zoom Quiet
 
ImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yZoom Quiet
 
Import this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersImport this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersZoom Quiet
 
金山卫士界面框架
金山卫士界面框架金山卫士界面框架
金山卫士界面框架Zoom Quiet
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysqlZoom Quiet
 
111030 gztechparty-小路-sophia
111030 gztechparty-小路-sophia111030 gztechparty-小路-sophia
111030 gztechparty-小路-sophiaZoom Quiet
 

More from Zoom Quiet (20)

产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变产品信息收集系统Infoc的演变
产品信息收集系统Infoc的演变
 
Go courseday3
Go courseday3Go courseday3
Go courseday3
 
Go courseday2
Go courseday2Go courseday2
Go courseday2
 
Go courseday1
Go courseday1Go courseday1
Go courseday1
 
01s0401 go,互联网时代的c语言 许式伟
01s0401 go,互联网时代的c语言   许式伟01s0401 go,互联网时代的c语言   许式伟
01s0401 go,互联网时代的c语言 许式伟
 
Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿Zoz pwned-by-the-owner-表惹程序猿
Zoz pwned-by-the-owner-表惹程序猿
 
金山云查询系统改进之路1
金山云查询系统改进之路1金山云查询系统改进之路1
金山云查询系统改进之路1
 
Zh120226techparty zd-story
Zh120226techparty zd-storyZh120226techparty zd-story
Zh120226techparty zd-story
 
Zh120226techparty velocity2011-review
Zh120226techparty velocity2011-reviewZh120226techparty velocity2011-review
Zh120226techparty velocity2011-review
 
Zh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolboxZh120226techparty jeff kit-ios-toolbox
Zh120226techparty jeff kit-ios-toolbox
 
Velocity2011分享
Velocity2011分享Velocity2011分享
Velocity2011分享
 
陈正 Introduction to-sae_python
陈正   Introduction to-sae_python陈正   Introduction to-sae_python
陈正 Introduction to-sae_python
 
111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿111218 zhtechparty-panda讲稿
111218 zhtechparty-panda讲稿
 
111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析111218 zhtechparty-移动互联网产品需求分析
111218 zhtechparty-移动互联网产品需求分析
 
111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发111218 zhtechparty-zd-浅谈symbian开发
111218 zhtechparty-zd-浅谈symbian开发
 
ImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_yImpoImport this, that, and the other thing: custom importersrt not for_y
ImpoImport this, that, and the other thing: custom importersrt not for_y
 
Import this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importersImport this, that, and the other thing: custom importers
Import this, that, and the other thing: custom importers
 
金山卫士界面框架
金山卫士界面框架金山卫士界面框架
金山卫士界面框架
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql
 
111030 gztechparty-小路-sophia
111030 gztechparty-小路-sophia111030 gztechparty-小路-sophia
111030 gztechparty-小路-sophia
 

110407 liupeng-深入windows窗口和消息