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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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一区二区三区免费野_久草精品视频
久久精品视频在线看| 午夜视频一区二区三区| 亚洲欧洲99久久| 日韩av电影天堂| 97久久超碰精品国产| 91精品午夜视频| 国产精品久久久久久久午夜片 | 91美女精品福利| 91麻豆精品国产| 亚洲伦理在线精品| 国产电影精品久久禁18| 在线不卡的av| 亚洲最大成人网4388xx| 成人激情文学综合网| 91精品国产乱| 亚洲图片欧美综合| 91亚洲男人天堂| 国产精品色婷婷久久58| 欧美aaaaa成人免费观看视频| 一本一本大道香蕉久在线精品 | 91精品国产91久久综合桃花| 国产精品每日更新在线播放网址| 日本亚洲三级在线| 5858s免费视频成人| 一区二区在线观看视频| 国产东北露脸精品视频| 精品日韩99亚洲| 日本aⅴ精品一区二区三区 | 久久久蜜臀国产一区二区| 日本欧美久久久久免费播放网| 91麻豆国产福利在线观看| 欧美韩国日本不卡| 国产精品一区二区久久精品爱涩 | 国产99一区视频免费| 日韩精品一区二区三区老鸭窝| 一区二区三区欧美在线观看| 97久久精品人人做人人爽| 国产精品美女久久久久久久久久久 | 一区二区成人在线| 91色乱码一区二区三区| 综合欧美亚洲日本| 色天使久久综合网天天| 亚洲一区二区三区不卡国产欧美| 综合色天天鬼久久鬼色| 久久精品国产99国产| 欧美精品在线一区二区三区| 日韩和欧美的一区| 欧美一级午夜免费电影| 老司机午夜精品| 精品免费99久久| 国产一区二区0| 久久久久久亚洲综合影院红桃 | 久久久99免费| 国产成人一区在线| 亚洲人xxxx| 91精品欧美福利在线观看| 免费一区二区视频| 国产欧美日韩三区| 91福利视频在线| 青青国产91久久久久久| 2020国产精品自拍| www.性欧美| 亚洲第一久久影院| 日韩欧美一级在线播放| 国产福利一区二区| 亚洲主播在线观看| 久久久久久日产精品| 一本一道久久a久久精品综合蜜臀| 亚洲制服丝袜av| 日韩精品一区二区三区蜜臀| 成人国产精品视频| 日本特黄久久久高潮| 国产性做久久久久久| 91黄色免费观看| 激情综合色综合久久综合| 国产精品久久久久aaaa| 欧美老肥妇做.爰bbww| 国产原创一区二区| 亚洲综合成人在线视频| 久久中文字幕电影| 欧美三级欧美一级| 成人av小说网| 精品一区二区免费在线观看| 亚洲欧洲av色图| 精品国偷自产国产一区| 在线亚洲精品福利网址导航| 韩国欧美一区二区| 亚洲国产精品久久久男人的天堂| 精品成人免费观看| 欧美日韩一区二区三区四区| 国产一区二区三区四| 亚洲国产精品精华液网站| 国产精品三级久久久久三级| 欧美一区二区三区四区五区 | av不卡免费在线观看| 美女一区二区三区| 一区二区高清在线| 国产精品网曝门| 亚洲精品一线二线三线无人区| 在线影视一区二区三区| 国产成人av资源| 久久成人综合网| 亚洲成人福利片| 一区二区三区在线影院| 中文字幕在线一区二区三区| 欧美tickling挠脚心丨vk| 欧美情侣在线播放| 欧美午夜影院一区| 91福利视频网站| 色婷婷亚洲综合| 91社区在线播放| 91女厕偷拍女厕偷拍高清| 黄色日韩三级电影| 久久99精品国产麻豆婷婷| 午夜av一区二区三区| 一区二区不卡在线播放 | 亚洲成人av一区二区| 日韩毛片一二三区| 亚洲视频免费看| 国产精品国产a级| 国产精品国产精品国产专区不蜜 | 国产一区二区三区在线看麻豆| 亚洲第一在线综合网站| 性做久久久久久免费观看| 亚洲精品视频免费观看| 亚洲私人影院在线观看| 综合欧美亚洲日本| 亚洲国产毛片aaaaa无费看| 一区二区在线免费| 亚洲高清不卡在线| 蜜臀av亚洲一区中文字幕| 日韩高清在线电影| 国产呦精品一区二区三区网站| 精品一区二区三区免费播放| 国产综合久久久久影院| 粉嫩av一区二区三区| 99国产精品视频免费观看| 在线一区二区三区做爰视频网站| 欧洲视频一区二区| 欧美理论电影在线| 亚洲国产岛国毛片在线| 亚洲人成在线观看一区二区| 亚洲精品国产a久久久久久| 亚洲国产视频直播| 狠狠色丁香婷综合久久| 不卡视频在线观看| 在线精品视频免费观看| 日韩美女视频在线| 中国色在线观看另类| 亚洲国产wwwccc36天堂| 久久机这里只有精品| 成人午夜在线视频| 欧美日本国产视频| 中文字幕乱码一区二区免费| 亚洲欧洲综合另类| 免费视频一区二区| www.av亚洲| 亚洲精品在线免费播放| 亚洲精品视频一区| 国内成+人亚洲+欧美+综合在线 | 成人av网站免费观看| 欧美另类变人与禽xxxxx| 久久精品男人的天堂| 亚洲综合无码一区二区| 国内精品写真在线观看| 色哟哟日韩精品| 久久久五月婷婷| 手机精品视频在线观看| 国产.精品.日韩.另类.中文.在线.播放 | 午夜精品福利一区二区三区av| 久久99精品国产麻豆不卡| 一本大道综合伊人精品热热| www国产成人免费观看视频 深夜成人网| 亚洲男人都懂的| 国产69精品久久777的优势| 欧美一区三区四区| 亚洲综合色噜噜狠狠| 国产九色精品成人porny| 91精品国产91久久久久久一区二区| 国产精品网站在线播放| 韩国欧美国产1区| 欧美日韩一区二区三区视频| 中文字幕精品一区| 麻豆freexxxx性91精品| 欧美亚洲国产一区二区三区va| 国产精品久久三区| 国产成人免费在线视频| 日韩精品中文字幕一区二区三区| 一区二区三区免费网站| 成人黄色a**站在线观看| 26uuu另类欧美亚洲曰本| 热久久免费视频| 538prom精品视频线放| 亚洲一区二区三区四区五区黄 | 韩国一区二区视频| 日韩女优av电影| 久久99精品网久久| 精品精品欲导航| 日本午夜精品视频在线观看| 欧美区视频在线观看|