﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-bullGao-随笔分类-读书笔记</title><link>http://www.cppblog.com/bestgz/category/3149.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 27 May 2008 01:13:48 GMT</lastBuildDate><pubDate>Tue, 27 May 2008 01:13:48 GMT</pubDate><ttl>60</ttl><item><title>Windows编程知识入门</title><link>http://www.cppblog.com/bestgz/archive/2006/12/10/16233.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Sun, 10 Dec 2006 09:40:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/12/10/16233.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/16233.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/12/10/16233.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/16233.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/16233.html</trackback:ping><description><![CDATA[
		<p dir="ltr" style="MARGIN-RIGHT: 0px">
				<font color="#ff0000">窗口</font>的概念：<br />      窗口是Windows应用程序的基本操作单元，是系统管理应用程序的基本单元，是应用程序与用户之间交互的接口环境。应用程序的运行过程是窗口内部、窗口与窗口之间、窗口与系统之间进行数据处理与数据交换的过程。因此，编写Windows应用程序首先应创建一个或多个窗口。<br />      一个应用程序的窗口一般包括窗口边界、工作区、控制菜单框、控制菜单、水平垂直滚动条以及最大化按钮、最小化按钮和标题栏等对象。<br /><br /><br /><font color="#ff0000">事件驱动</font>的概念：<br />      Windows程序设计围绕着事件或消息的产生驱动运行消息处理函数。所谓<font color="#000000"><font color="#9acd32">消息</font>是描述事件发生的信息</font>。例如按下键盘上的某一个键时，系统就会产生一条特定的消息，标识案件事件的发生，这里的事件包含按下键的消息、字符消息和键的弹起消息。Windows程序的执行顺序取决于事件发生的顺序，程序执行顺序是由顺序产生的消息驱动的，但是消息产生往往并不要求有次序之分。程序员可以针对消息类型编写消息处理程序已处理接收的消息，或者发出其他消息以驱动其他处理程序，但是不必预先确定消息产生的次序。这是面向对象编成的最显著特点，也是与传统面向过程编程方法的重要区别之一。<br />      事件驱动编程方法对于编写交互式程序很有用处，用这一方法编写的程序使程序避免了死板的操作模式，从而使用户能够按照自己的意愿采用灵活多变的操作形式。<br /><br /><br /><font color="#ff0000">句柄</font><font color="#000000">：<br /></font>      句柄（handle）是<u>windows编程的基础</u>，它是一个<font color="#9acd32">4字节长</font>的整数值，用于标识应用程序中不同的对象和同类对象中不同的实例，诸如一个窗口、按钮、图表、滚动条、输出设备、控制或文件等对象，都需要一个唯一的句柄来标识，应用程序通过句柄来访问相应的对象信息。<br />      在Windows应用程序中，句柄的使用是很频繁的。部分常用句柄类型：<br />      HWND   标识窗口句柄<br />      HINSTANCE   标识当前实例句柄<br />      HCURSOR   标识光标句柄<br />      HFONT   标识字体句柄<br />      HPEN   标识画笔句柄<br />      HBRUSH   标识画刷句柄<br />      HDC   标识设备环境句柄<br />      HBITMAP   标识位图句柄<br />      HICON   标识图标句柄<br />      HMENU   标识菜单句柄<br />      HFILE   标识文件句柄<br /><br />Windows应用程序利用Windows消息（Message）与其他Windows应用程序及Windows系统进行信息交换。Windows中消息由三部分<font color="#ff0000">组成</font>：<u>消息号、字参数和长字参数</u>。<br />   消息号是事先定义好的消息名标识；字参数（wParam）和长字参数（lParam）用于提供消息的附加信息，附加信息的含义与具体消息号有关。Windows中的消息往往用一个结构体MSG来表示，结构体MSG的定义如下：<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">typedef </span>
				<span style="COLOR: #0000ff">struct</span>
				<span style="COLOR: #000000"> tagMSG<br /><img id="Codehighlighter1_22_236_Open_Image" onclick="this.style.display='none'; Codehighlighter1_22_236_Open_Text.style.display='none'; Codehighlighter1_22_236_Closed_Image.style.display='inline'; Codehighlighter1_22_236_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_22_236_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_22_236_Closed_Text.style.display='none'; Codehighlighter1_22_236_Open_Image.style.display='inline'; Codehighlighter1_22_236_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span>
				<span id="Codehighlighter1_22_236_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.cppblog.com/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_22_236_Open_Text">
						<span style="COLOR: #000000">{    HWND  hwnd;  </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> 获取消息的窗口句柄，若此参数为null，则可检索所有驻留在消息队列中的消息</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">     UINT  message; </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> 消息编号</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">     WPARAM # wParam; </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> 消息的附加信息</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">     LPARAM # lParam; <br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />     DWORD  time; </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> 指定消息发送至消息队列的时间</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">     POINT  pt; </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> 指定消息发送时，屏幕光标的位置</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />
						</span>
						<span style="COLOR: #000000">}</span>
				</span>
				<span style="COLOR: #000000"> MSG;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /></span>
		</div>
		<br />其中pt的数据类型也是一个结构体PIONT，其定义为：<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">typedef </span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> tagPOINT<br /><img id="Codehighlighter1_24_73_Open_Image" onclick="this.style.display='none'; Codehighlighter1_24_73_Open_Text.style.display='none'; Codehighlighter1_24_73_Closed_Image.style.display='inline'; Codehighlighter1_24_73_Closed_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_24_73_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_24_73_Closed_Text.style.display='none'; Codehighlighter1_24_73_Open_Image.style.display='inline'; Codehighlighter1_24_73_Open_Text.style.display='inline';" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_24_73_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cppblog.com/images/dot.gif" /></span><span id="Codehighlighter1_24_73_Open_Text"><span style="COLOR: #000000">{    LONG x;  </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> x和y分别表示屏幕的横坐标和纵坐标</span><span style="COLOR: #008000"><br /><img src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">      LONG y;<br /><img src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000"> POINT;</span></div><p><br /><br /><font color="#ff0000">消息</font>：<br />      VC++中存在几种系统定义的消息分类，常用的消息分类有窗口管理消息、初始化消息、输入消息、系统消息、剪贴板消息、控制处理消息、控制通知消息、滚动条通知信息、非用户区消息、文档界面消息、DDE（动态数据交换）消息、应用程序自定义的消息等。<br />系统定义的消息宏前缀：<br />BM   <u>按钮</u>控制消息；<br />CB   <u>组合框</u>控制消息；<br />DM   <u>默认下压式按钮控制</u>消息；<br />EM   <u>编辑</u>控制消息；<br />LB    <u>列表</u>控制消息；<br />SBM   <u>滚动条</u>控制消息；<br />WM   <u>窗口</u>消息；</p><p> </p><p>windows 应用程序常用消息：</p><img src ="http://www.cppblog.com/bestgz/aggbug/16233.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-12-10 17:40 <a href="http://www.cppblog.com/bestgz/archive/2006/12/10/16233.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Inheritance Example</title><link>http://www.cppblog.com/bestgz/archive/2006/12/06/16063.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Wed, 06 Dec 2006 12:35:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/12/06/16063.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/16063.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/12/06/16063.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/16063.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/16063.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Hierarchy using private Data, and three-level Inheritance Hierarchy:Circle类继承了Point类，而Cylinder类继承了Circle类，同时调用基类的构造函数，初始化数据Circle具有Point的特性，Cylinder具有Circle的特性，形成了三级继承关系base-class:												...&nbsp;&nbsp;<a href='http://www.cppblog.com/bestgz/archive/2006/12/06/16063.html'>阅读全文</a><img src ="http://www.cppblog.com/bestgz/aggbug/16063.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-12-06 20:35 <a href="http://www.cppblog.com/bestgz/archive/2006/12/06/16063.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>some terminology</title><link>http://www.cppblog.com/bestgz/archive/2006/11/30/15814.html</link><dc:creator>bullGao</dc:creator><author>bullGao</author><pubDate>Thu, 30 Nov 2006 07:49:00 GMT</pubDate><guid>http://www.cppblog.com/bestgz/archive/2006/11/30/15814.html</guid><wfw:comment>http://www.cppblog.com/bestgz/comments/15814.html</wfw:comment><comments>http://www.cppblog.com/bestgz/archive/2006/11/30/15814.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bestgz/comments/commentRss/15814.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bestgz/services/trackbacks/15814.html</trackback:ping><description><![CDATA[
		<p>two classes of language translation proccess: <font color="#ff0000">Interpreters</font> and <font color="#ff0000">Compliers<br /><br /></font><font color="#000000"><font color="#ff0000">type checking</font>: test for the proper use of arguments in functions and prevents many kinds of programming errors.<br />dynamic type checking: perform type check at runtime.<br />static type checking: type checking occurs during compilation instead of when the program is running.<br /><br />Declearations and Definitions:<br />A <font color="#ff0000">declaration</font> introduces a name - an identifier - to the complier. It tells the complier "This function or this variable exists somewhere, and here is what it should look like."<br />A definition, on the other hand , says:" Make this variable here" or "Make this function here." It allocates storage for the name.<br />You can declear a varable or a function in many different places, but only one definition can be made in C and C++<br />ODR: one - definition - rule.<br /><br />concatenation 串联</font></p>
<img src ="http://www.cppblog.com/bestgz/aggbug/15814.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bestgz/" target="_blank">bullGao</a> 2006-11-30 15:49 <a href="http://www.cppblog.com/bestgz/archive/2006/11/30/15814.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>