亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch08.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	
	<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 8 -- Messages and Event-Driven Programming</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="sams.gif" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
<FONT COLOR="#000077">Teach Yourself Visual C++&#174; 5 in 24 Hours</FONT></H1>
</CENTER>
<CENTER>
<P><A HREF="ch07.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch07/ch07.htm"><IMG SRC="previous.gif" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="ch09.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch09/ch09.htm"><IMG
SRC="next.gif" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="index-1.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/index.htm"><IMG SRC="contents.gif" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1><FONT COLOR="#000077">- Hour 8 -<BR>
Messages and Event-Driven Programming</FONT></H1>
</CENTER>
<P>Messages are at the heart of every Windows program. Even the 50-line MFC program
in Hour 2, &quot;Writing Simple C++ Programs,&quot; had to handle the <TT>WM_PAINT</TT>
message. A good understanding of how the Windows operating system sends messages
will be a great help to you as you write your own programs.</P>
<P>In this hour, you will learn

<UL>
	<LI>How Windows applications use messages to communicate with the operating system
	and window objects in the application<BR>
	<BR>
	
	<LI>How messages are managed using the MFC framework<BR>
	<BR>
	
	<LI>Some basic information about the Document/View architecture and how AppWizard
	is used to create Document/View applications<BR>
	<BR>
	
	<LI>MFC base classes that are used in every MFC application
</UL>

<P>In this hour, you will also create a small sample program to learn how messages
are passed to applications by the Windows operating system.
<H2><FONT COLOR="#000077"><B>Understanding the Windows Programming Model</B></FONT></H2>
<P>Programs written for Windows differ from most console-mode programs. The console-mode
programs that you have seen in this book have consisted of short listings that created
small sequential programs that assumed complete control over a console-mode window.</P>
<P>Although sequential programs work well for explaining simple concepts like the
basics of the C++ language, they don't work well in a multitasking environment like
Microsoft Windows. In the Windows environment everything is shared: the screen, the
keyboard, the mouse--even the user. Programs written for Windows must cooperate with
Windows and with other programs that might be running at the same time.</P>
<P>In a cooperative environment like Windows, messages are sent to a program when
an event that affects the program occurs. Every message sent to a program has a specific
purpose. For example, messages are sent when a program should be initialized, when
menu selections are made, and when a window should be redrawn. Responding to event
messages is a key part of most Windows programs.</P>
<P>Another characteristic of Windows programs is that they must share resources.
Many resources must be requested from the operating system before they are used and,
after they are used, must be returned to the operating system so that they can be
used by other programs. This is one way Windows controls access to resources like
the screen and other physical devices.</P>
<P>In short, a program that runs in a window must be a good citizen. It cannot assume
that it has complete control over the computer on which it is running; it must ask
permission before taking control of any central resource, and it must be ready to
react to events that are sent to it.
<H2><FONT COLOR="#000077"><B>Using AppWizard with Document/View</B></FONT></H2>
<P>As you saw in the first few hours, the Developer Studio includes a tool, AppWizard
(also called MFC AppWizard), which is used to create a skeleton application. AppWizard
asks you a series of questions about your program; then it generates a project and
much of the source code for you, letting you concentrate on the code that makes your
program unique.</P>
<P>So far you have used AppWizard to create programs that use a dialog box as their
main window. However, the real strength of AppWizard is its capability to help you
create full Windows applications. Much of the code that is used as a starting point
for Windows programs is generic &quot;skeleton&quot; code; AppWizard will generate
this code for you.


<BLOCKQUOTE>
	<P>
<HR>
<B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>The MFC class library
	is built around the Document/View programming model. Using AppWizard to create the
	skeleton code for your program is the quickest way to get started writing Document/View
	programs. 
<HR>


</BLOCKQUOTE>

<H3><FONT COLOR="#000077"><B>A Quick Overview of the Document/View Architecture</B></FONT></H3>
<P>The AppWizard uses MFC classes to create applications that are based on the MFC
Document/View architecture. The basic idea behind Document/View is to separate the
data-handling classes from the classes that handle the user interface.</P>
<P>Separating the data from the user interface enables each class to concentrate
on performing one job, with a set of interfaces defined for interaction with the
other classes involved in the program. A view class is responsible for providing
a &quot;viewport&quot; through which you can see and manage the document. A document
class is responsible for controlling all the data, including storing it when necessary.
Figure 8.1 shows how the document and view classes interact with each other.</P>
<P><A NAME="01"></A><A HREF="01.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch08/01.htm"><B>Figure 8.1.</B></A> <I><BR>
The Document/View architecture.</I></P>
<P>You will learn more about the Document/View architecture in Hour 9, &quot;The
Document/View Architecture.&quot; For now, just be aware that four main &quot;super
classes&quot; are used in a Document/View application:

<UL>
	<LI>The<I> document</I> class controls the data used by an application. The data
	does not have to be an actual page of text; for example, a spreadsheet or project
	plan can easily be represented as a document.<BR>
	<BR>
	
	<LI>The<I> view</I> class is used to display information about the document to the
	user and to handle any interaction that is required between the user and the document.<BR>
	<BR>
	
	<LI>The <I>frame</I> class is used to physically contain the view, menu, toolbar,
	and other physical elements of the program<I>.</I><BR>
	<BR>
	
	<LI>The <I>application</I> class controls the application-level interaction with
	Windows.
</UL>

<P>In addition to the four classes listed here, you will learn in Hour 9 some specialized
classes that are used in Document/View programs.
<H3><FONT COLOR="#000077"><B>Types of Applications Built by AppWizard</B></FONT></H3>
<P>AppWizard sets up the following types of generic programs for you:

<UL>
	<LI><I>Single Document</I>, or SDI: A program that controls a single document at
	a time<BR>
	<BR>
	
	<LI><I>Multiple Document</I>, or MDI: A program that can control several different
	documents at once<BR>
	<BR>
	
	<LI><I>Dialog based</I>: A program that has a dialog box as its main display window
</UL>

<P>After you select one of these application types, you are asked for more information
about the new program. The opening MFC AppWizard screen is shown in Figure 8.2.</P>
<P><A NAME="02"></A><A HREF="02.htm" tppabs="http://www.mcp.com/824169600/0-672/0-672-31242-5/ch08/02.htm"><B>Figure 8.2.</B> </A><I><BR>
The opening screen for MFC AppWizard.</I>
<H3><FONT COLOR="#000077"><B>Using AppWizard to Create an SDI Application</B></FONT></H3>
<P>To create a simple SDI program, select Single Document on the opening MFC AppWizard
screen. AppWizard displays six Wizard pages filled with default information for a
typical SDI program. You can move to the next page by pressing the button labeled
Next and to the previous page by pressing the button labeled Back. At any time you
can tell AppWizard to create the project for you by pressing the button labeled Finish.</P>
<P>AppWizard will create several classes and files for you and create a project that
you can use to manage the process of compiling the program. AppWizard creates these
classes for a program named Hello:

<UL>
	<LI><TT>CHelloApp</TT>: Derived from <TT>CWinApp</TT>, the application class for
	the program<BR>
	<BR>
	
	<LI><TT>CHelloDoc</TT>: The program's document class, derived from <TT>CDocument</TT><BR>
	<BR>
	
	<LI><TT>CHelloView</TT>: The program's view class derived from <TT>CView</TT><BR>
	<BR>
	
	<LI><TT>CMainFrame</TT>: The main frame class for the program
</UL>

<P>In addition, AppWizard creates several files that are not used for C++ classes.
Some of these files are

<UL>
	<LI><TT>hello.aps</TT>: A file that contains a precompiled version of the program's
	resources<BR>
	<BR>
	
	<LI><TT>hello.clw</TT>: A file that contains information used by ClassWizard<BR>
	<BR>
	
	<LI><TT>readme.txt</TT>: A file that has information about all the files created
	by AppWizard<BR>
	<BR>
	
	<LI><TT>hello.rc</TT>: A resource file that contains information about dialog boxes,
	menus, and other resources used by the program<BR>
	<BR>
	
	<LI><TT>resource.h</TT>: A header file containing declarations needed for the resources
	used by the program<BR>
	<BR>
	
	<LI><TT>hello.dsp</TT> and <TT>hello.dsw</TT>: The project and workspace files used
	by Developer Studio to build the program<BR>
	<BR>
	
	<LI><TT>stdafx.cpp</TT>: A file included in all AppWizard programs that includes
	all the standard <TT>include</TT> files<BR>
	<BR>
	
	<LI><TT>stdafx.h</TT>: A standard header file included in all AppWizard programs
	that is used to include other files that are included in the precompiled headers
</UL>

<P>Creating a Windows program using AppWizard is easy. In fact, you can compile and
run the program as it is now, although it doesn't really do anything.
<H2><FONT COLOR="#000077"><B>What Are Messages?</B></FONT></H2>
<P>Programs written for Microsoft Windows react to events that are sent to a program's
main window. Examples of events include moving the mouse pointer, clicking a button,
or pressing a key. These events are sent to the window in the form of messages. Each
message has a specific purpose: redraw the window, resize the window, close the window,
and so on.</P>
<P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>The <I>default window procedure</I>
is a special message-handling function supplied by Windows that handles the message
if no special processing is required.</P>
<P>For many messages, the application can just pass the message to the default window
procedure.</P>
<P>A Windows program can also send messages to other windows. Because every control
used in a Windows program is also a window, messages are also often used to communicate
with controls.</P>
<P>Two different types of messages are handled by a Windows program:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美a一区二区| 欧美另类变人与禽xxxxx| 欧美丝袜第三区| 亚洲国产精品v| 久久激情五月激情| 欧美午夜电影在线播放| 久久精品无码一区二区三区| 午夜不卡av在线| 9人人澡人人爽人人精品| 久久亚洲综合色| 日本aⅴ亚洲精品中文乱码| 91久久免费观看| 国产精品人妖ts系列视频| 男人操女人的视频在线观看欧美| 欧美自拍偷拍一区| 亚洲欧洲av在线| kk眼镜猥琐国模调教系列一区二区| 91精品国产麻豆国产自产在线 | 一区二区欧美国产| 国产91清纯白嫩初高中在线观看| 日韩欧美一二三四区| 亚洲va韩国va欧美va精品 | 国v精品久久久网| 日韩免费观看高清完整版在线观看| 亚洲图片自拍偷拍| 欧美视频一区二区三区在线观看| 亚洲激情中文1区| 91久久线看在观草草青青| 亚洲欧美一区二区不卡| 成人动漫av在线| 自拍偷拍欧美激情| 欧美吞精做爰啪啪高潮| 性做久久久久久久久| 欧美日韩国产成人在线免费| 午夜欧美电影在线观看| 欧美日韩大陆一区二区| 蜜臀av性久久久久蜜臀aⅴ| 日韩视频在线一区二区| 久久99国产精品免费| 国产丝袜欧美中文另类| 91在线小视频| 亚洲一区二区在线观看视频| 91精品福利在线| 日本一道高清亚洲日美韩| 精品日韩在线观看| 国产69精品久久久久777| 中文字幕一区二区在线观看| 91国偷自产一区二区使用方法| 亚洲精品免费看| 欧美日本视频在线| 精品一区二区三区久久| 国产精品理论在线观看| 欧美综合视频在线观看| 久久精品久久精品| 综合在线观看色| 欧美一区二区三区系列电影| 国产在线精品一区二区夜色| 中文在线免费一区三区高中清不卡| 色婷婷亚洲一区二区三区| 午夜不卡av在线| 国产女人18水真多18精品一级做| 99视频在线精品| 免费人成精品欧美精品| 国产精品丝袜一区| 欧美绝品在线观看成人午夜影视| 国产综合久久久久影院| 亚洲精品免费播放| 久久精品在线观看| 欧美日韩成人在线一区| 成人午夜激情在线| 日本女优在线视频一区二区| 国产精品欧美极品| 日韩精品最新网址| 欧日韩精品视频| 成人福利电影精品一区二区在线观看| 亚洲国产日韩综合久久精品| 久久久亚洲精华液精华液精华液| 色婷婷av一区二区三区gif| 国产在线精品一区二区不卡了| 亚洲小说春色综合另类电影| 欧美经典三级视频一区二区三区| 欧美日韩欧美一区二区| 成人h动漫精品一区二| 三级久久三级久久久| 亚洲欧美一区二区三区久本道91 | 蜜臀va亚洲va欧美va天堂 | 中文字幕av一区二区三区高| 91精品国产一区二区三区 | 日韩国产一区二| 亚洲精品视频自拍| 中文字幕一区二区三区色视频| 久久伊人中文字幕| 日韩午夜av电影| 欧美久久久一区| 在线视频国产一区| eeuss鲁片一区二区三区| 国产资源在线一区| 久久99精品国产.久久久久| 日本不卡中文字幕| 亚洲图片有声小说| 亚洲一区影音先锋| 亚洲免费观看在线视频| 国产精品超碰97尤物18| 国产精品福利一区| 国产精品免费aⅴ片在线观看| 国产欧美日韩亚州综合 | 91麻豆精品国产91| 欧美性生活一区| 日本韩国一区二区三区| 99久久久无码国产精品| 成人精品在线视频观看| 不卡一二三区首页| 91香蕉视频污在线| 91女人视频在线观看| 91一区二区在线| 91丝袜美女网| 欧美专区日韩专区| 欧美日韩高清影院| 欧美一区二区三区视频免费| 日韩女优视频免费观看| 久久看人人爽人人| 国产蜜臀97一区二区三区| 中文字幕亚洲欧美在线不卡| 国产精品国产精品国产专区不蜜 | 91精品福利视频| 欧美午夜不卡在线观看免费| 欧美人妖巨大在线| 日韩三区在线观看| 久久亚洲私人国产精品va媚药| 国产亚洲精品aa| 亚洲人成7777| 日本va欧美va瓶| 国产成人精品三级| 在线免费不卡电影| 精品剧情在线观看| 日韩美女精品在线| 亚洲成人自拍网| 国产一区三区三区| 色婷婷综合久久久中文字幕| 7777女厕盗摄久久久| 国产日产亚洲精品系列| 亚洲人快播电影网| 毛片av中文字幕一区二区| 粉嫩久久99精品久久久久久夜| 一本大道久久精品懂色aⅴ| 欧美喷水一区二区| 国产精品视频第一区| 午夜婷婷国产麻豆精品| 成人一区二区视频| 欧美疯狂做受xxxx富婆| 国产精品色噜噜| 日韩高清欧美激情| 不卡av在线免费观看| 在线电影一区二区三区| 国产精品久久久久久亚洲伦| 偷拍日韩校园综合在线| 成人久久视频在线观看| 日韩欧美亚洲一区二区| 亚洲综合在线电影| 成人污污视频在线观看| 日韩视频一区二区在线观看| 亚洲色图一区二区| 狠狠狠色丁香婷婷综合久久五月| 色香蕉久久蜜桃| 欧美高清在线一区二区| 蜜乳av一区二区| 欧美性大战xxxxx久久久| 国产精品伦理一区二区| 麻豆精品久久久| 欧美日韩中文字幕精品| 国产精品久久久一本精品| 日产欧产美韩系列久久99| 色综合婷婷久久| 久久久久九九视频| 麻豆精品久久精品色综合| 欧美视频在线观看一区二区| 《视频一区视频二区| 国产剧情一区二区| 日韩欧美国产1| 亚洲h动漫在线| 在线观看日韩毛片| 亚洲另类在线一区| 99在线精品一区二区三区| 国产午夜精品理论片a级大结局 | 国产成人精品亚洲777人妖| 日韩欧美亚洲另类制服综合在线| 午夜影院在线观看欧美| 欧美在线综合视频| 亚洲欧美日韩电影| 91网上在线视频| 亚洲欧美精品午睡沙发| 99久久伊人精品| 亚洲特黄一级片| 99国产精品久久久| 18成人在线观看| 一本一道久久a久久精品综合蜜臀| 国产精品久久久久久久午夜片| 成人爽a毛片一区二区免费| 欧美激情一区二区三区四区| 成人理论电影网|