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

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

?? ch08.htm

?? 一天之內(nèi)學(xué)會VC#. 主要介紹VC#的各種應(yīng)用和示例
?? 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:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久影院电视剧免费观看| 不卡av在线免费观看| 欧美一区二区在线免费观看| 亚洲精品免费播放| 欧美日韩不卡一区| 美女爽到高潮91| 2023国产精品自拍| 成人福利视频在线| 亚洲综合视频网| 欧美日韩一级片网站| 丝袜亚洲另类欧美| 久久久午夜精品理论片中文字幕| 国产自产视频一区二区三区| 国产精品激情偷乱一区二区∴| 色噜噜狠狠成人中文综合| 日韩激情视频在线观看| 久久综合给合久久狠狠狠97色69| 国产suv一区二区三区88区| 亚洲欧美在线高清| 欧美日本精品一区二区三区| 国产伦精品一区二区三区在线观看 | 精品日韩成人av| www.欧美精品一二区| 亚洲gay无套男同| 久久综合久久99| 欧美亚洲综合久久| 国产精品99久久久久久久vr| 一区二区欧美在线观看| 久久综合九色综合欧美亚洲| 91久久人澡人人添人人爽欧美| 裸体歌舞表演一区二区| 一个色综合网站| 久久免费视频一区| 欧美日精品一区视频| 国产主播一区二区| 亚洲一区二区三区免费视频| 久久久国产一区二区三区四区小说 | 精品久久久久99| 在线一区二区视频| 国产精品一区二区久久精品爱涩| 亚洲国产日韩在线一区模特| 久久久久久久久久久99999| 欧美伊人久久大香线蕉综合69| 国产综合久久久久久鬼色| 亚洲风情在线资源站| 国产精品卡一卡二卡三| 欧美电影免费观看高清完整版| 色综合久久88色综合天天6| 狠狠色伊人亚洲综合成人| 夜夜爽夜夜爽精品视频| 欧美激情一区二区三区四区| 在线不卡中文字幕| 欧美三级日韩在线| 91视视频在线观看入口直接观看www | 亚洲欧美一区二区三区国产精品 | 日本不卡一区二区三区 | 欧美视频在线观看一区二区| 成人性生交大片免费看中文网站| 久久国产精品99久久人人澡| 午夜影视日本亚洲欧洲精品| 亚洲欧美日韩在线播放| 国产精品美女久久久久久久久| 精品国产不卡一区二区三区| 678五月天丁香亚洲综合网| 91蝌蚪porny| jlzzjlzz亚洲日本少妇| 成人免费看视频| 国产成a人无v码亚洲福利| 九九久久精品视频| 免费观看30秒视频久久| 日韩av成人高清| 日欧美一区二区| 蜜臀av性久久久久蜜臀av麻豆| 丝袜亚洲精品中文字幕一区| 亚洲第一主播视频| 香蕉av福利精品导航| 午夜免费久久看| 无吗不卡中文字幕| 美女在线一区二区| 免费欧美日韩国产三级电影| 日本少妇一区二区| 免费成人你懂的| 国产一区欧美二区| 国产精品18久久久久久久久久久久 | 亚洲bt欧美bt精品| 日韩和欧美一区二区三区| 秋霞电影网一区二区| 免费精品视频在线| 国产福利精品一区二区| 国产91露脸合集magnet| av一区二区三区| 97精品国产露脸对白| 欧美这里有精品| 欧美日韩一级大片网址| 日韩欧美一二区| 久久精品一区二区三区四区| 国产调教视频一区| 亚洲综合成人在线视频| 日本欧美在线观看| 粉嫩绯色av一区二区在线观看 | 亚洲综合成人在线视频| 久久国产精品免费| 99视频精品免费视频| 欧美日韩电影一区| 久久久国产午夜精品| 亚洲一区二区三区三| 韩国v欧美v亚洲v日本v| 色狠狠色狠狠综合| 日韩三级中文字幕| 国产精品久久久一区麻豆最新章节| 亚洲久本草在线中文字幕| 久久99国产精品久久99| 99精品欧美一区二区三区小说| 欧美日韩在线一区二区| 国产亚洲综合性久久久影院| 亚洲综合在线第一页| 国产伦精品一区二区三区视频青涩| 日本丰满少妇一区二区三区| 日韩精品一区二区三区老鸭窝| 1000部国产精品成人观看| 男人的j进女人的j一区| 91亚洲精品乱码久久久久久蜜桃 | 精品国产一区二区三区久久影院 | 成人av小说网| 欧美一区二区大片| 亚洲精选一二三| 国产盗摄一区二区三区| 91麻豆精品国产91久久久久| 中文字幕欧美区| 激情欧美日韩一区二区| 欧美三电影在线| 中文字幕在线不卡| 国产综合久久久久久久久久久久 | 黄色成人免费在线| 欧美日本精品一区二区三区| 国产精品国产三级国产aⅴ原创| 欧美伊人久久久久久久久影院 | 国产精品一区二区久激情瑜伽 | 欧美一区二区三区在线| 国产精品电影院| 国产精品911| 欧美一区二区精品| 亚洲资源在线观看| 91香蕉视频污在线| 久久婷婷久久一区二区三区| 日韩成人av影视| 欧美亚洲综合久久| 亚洲精品菠萝久久久久久久| 岛国av在线一区| 久久久精品日韩欧美| 韩国成人精品a∨在线观看| 日韩午夜三级在线| 五月天亚洲婷婷| 67194成人在线观看| 性久久久久久久久| 欧美精品 国产精品| 亚洲成a人片综合在线| 欧美日韩一级片网站| 亚洲韩国精品一区| 欧美三级日韩三级| 性欧美大战久久久久久久久| 欧美撒尿777hd撒尿| 亚洲成av人片一区二区三区| 在线国产电影不卡| 亚洲18影院在线观看| 51精品秘密在线观看| 日韩高清在线一区| 精品女同一区二区| 国产福利91精品| 国产精品视频一区二区三区不卡| 高清在线成人网| 亚洲日穴在线视频| 色av一区二区| 午夜精品久久久久久| 91精品国产综合久久久蜜臀图片| 视频在线观看国产精品| 日韩丝袜情趣美女图片| 国产麻豆成人精品| 国产精品激情偷乱一区二区∴| 91在线国产观看| 亚洲香肠在线观看| 日韩免费观看2025年上映的电影| 九色综合国产一区二区三区| 久久久精品免费观看| 99久久99久久久精品齐齐| 樱花影视一区二区| 7777精品伊人久久久大香线蕉的 | 午夜精品一区二区三区免费视频| 欧美日韩国产精品成人| 久久精品国产精品亚洲红杏| 久久久三级国产网站| 92国产精品观看| 亚洲大型综合色站| 久久综合九色综合97婷婷女人| 成人黄色a**站在线观看| 亚洲午夜成aⅴ人片| 久久综合精品国产一区二区三区| av网站免费线看精品| 天堂av在线一区| 国产嫩草影院久久久久|