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

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

?? ch03.htm

?? VisualC21天自學教程.rar 英文經典教程
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '</head>';
 zhtm += '<BODY bgcolor="#FFFFFF">
<!-- Spidersoft WebZIP Ad Banner Insert -->
<TABLE width=100% border="0" cellpadding="0" cellspacing="0">
<TR>
<TD>
<ILAYER id=ad1 visibility=hidden height=60></ILAYER>
<NOLAYER>
<IFRAME SRC="http://www.spidersoft.com/ads/bwz468_60.htm" width="100%" height="60" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></IFRAME>
</NOLAYER>
</TD>
</TR>
</TABLE>
<!-- End of Spidersoft WebZIP Ad Banner Insert-->
';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '
<layer src="http://www.spidersoft.com/ads/bwz468_60.htm" visibility=hidden id=a1 width=600 onload="moveToAbsolute(ad1.pageX,ad1.pageY); a1.clip.height=60;visibility='show';"></layer>
</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="../../../../includes/stylesheets/ebooks.css">

	<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1.1">
	<TITLE>Teach Yourself Visual C++ 6 in 21 Days -- Ch 3 -- Allowing User Interaction--Integrating the Mouse and Keyboard in Your Application</TITLE>
</HEAD>

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

<H1 ALIGN="CENTER"><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM"
BORDER="0"><BR>
Teach Yourself Visual C++ 6 in 21 Days</H1>
<CENTER>
<P><A HREF="../ch02/ch02.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch04/ch04.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<H1 ALIGN="CENTER">- 3 -<BR>
Allowing User Interaction--Integrating the Mouse and Keyboard in Your Application</H1>
<H1></H1>

<UL>
	<LI><A HREF="#Heading1">Understanding Mouse Events</A>
	<UL>
		<LI><A HREF="#Heading2">Drawing with the Mouse</A>
		<LI><A HREF="#Heading3">Improving the Drawing Program</A>
		<LI><A HREF="#Heading4">Adding the Finishing Touches</A>
	</UL>
	<LI><A HREF="#Heading5">Capturing Keyboard Events</A>
	<UL>
		<LI><A HREF="#Heading6">Changing the Drawing Cursor</A>
		<LI><A HREF="#Heading7">Making the Change Stick</A>
	</UL>
	<LI><A HREF="#Heading8">Summary</A>
	<LI><A HREF="#Heading9">Q&amp;A</A>
	<LI><A HREF="#Heading10">Workshop</A>
	<UL>
		<LI><A HREF="#Heading11">Quiz</A>
	</UL>
	<LI><A HREF="#Heading12">Exercises</A>
</UL>

<P>
<HR SIZE="4">
<BR>
Depending on the type of application you are creating, you might need to notice what
the user is doing with the mouse. You need to know when and where the mouse was clicked,
which button was clicked, and when the button was released. You also need to know
what the user did while the mouse button was being held down.</P>

<P>Another thing that you might need to do is read the keyboard events. As with the
mouse, you might need to know when a key was pressed, how long it was held down,
and when it was released.</P>
<P>Today you are going to learn</P>
<P>

<UL>
	<LI>What mouse events are available for use and how to determine which one is appropriate
	for your application's needs.
	<P>
	<LI>How you can listen to mouse events and how to react to them in your Visual C++
	application.
	<P>
	<LI>What keyboard events are available for use and what actions will trigger each
	of these events.
	<P>
	<LI>How to capture keyboard events and take action based on what the user pressed.
</UL>

<H2><A NAME="Heading1"></A>Understanding Mouse Events</H2>
<P>As you learned yesterday, when you are working with most controls, you are limited
to a select number of events that are available in the Class Wizard. When it comes
to mouse events, you are limited for the most part to click and double-click events.
Just looking at your mouse tells you that there must be more to capturing mouse events
than recognizing these two. What about the right mouse button? How can you tell if
it has been pressed? And what about drawing programs? How can they follow where you
drag the mouse?</P>
<P>If you open the Class Wizard in one of your projects, select the dialog in the
list of object IDs, and then scroll through the list of messages that are available,
you will find a number of mouse-related events, which are also listed in Table 3.1.
These event messages enable you to perform any task that might be required by your
application.</P>
<P>
<H4>TABLE 3.1. MOUSE EVENT MESSAGES.</H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT"><I>Message</I></TD>
		<TD ALIGN="LEFT"><I>Description</I></TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_LBUTTONDOWN		</TD>
		<TD ALIGN="LEFT">The left mouse button has been pressed.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_LBUTTONUP		</TD>
		<TD ALIGN="LEFT">The left mouse button has been released.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_LBUTTONDBLCLK		</TD>
		<TD ALIGN="LEFT">The left mouse button has been double-clicked.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_RBUTTONDOWN		</TD>
		<TD ALIGN="LEFT">The right mouse button has been pressed.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_RBUTTONUP		</TD>
		<TD ALIGN="LEFT">The right mouse button has been released.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_RBUTTONDBLCLK		</TD>
		<TD ALIGN="LEFT">The right mouse button has been double-clicked.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_MOUSEMOVE		</TD>
		<TD ALIGN="LEFT">The mouse is being moved across the application window space.		</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">WM_MOUSEWHEEL		</TD>
		<TD ALIGN="LEFT">The mouse wheel is being moved.		</TD>
	</TR>
</TABLE>

<H3><A NAME="Heading2"></A>Drawing with the Mouse</H3>
<P>Today you are going to build a simple drawing program that uses some of the available
mouse events to let the user draw simple figures on a dialog window. This application
depends mostly on the WM_MOUSEMOVE event message, which signals that the mouse is
being moved. You will look at how you can tell within this event function whether
the left mouse button is down or up. You will also learn how you can tell where the
mouse is on the window. Sound's fairly straight ahead, so let's get going by following
these steps:</P>
<P>

<DL>
	<DT></DT>
	<DD><B>1. </B>Create a new MFC AppWizard workspace project, calling the project <B>Mouse</B>.
	<P>
	<DT></DT>
	<DD><B>2. </B>Specify that this project will be a dialog-based application in the
	first AppWizard step.
	<P>
	<DT></DT>
	<DD><B>3. </B>Use the default settings in the AppWizard. In the second step, specify
	a suitable dialog title, such as <B>Mouse and Keyboard</B>.
	<P>
	<DT></DT>
	<DD><B>4. </B>After the application shell is created, remove all controls from the
	dialog window. This provides the entire dialog window surface for drawing. This step
	is also necessary for your application to capture any keyboard events.
	<P>
</DL>



<BLOCKQUOTE>
	<P>
<HR>
<STRONG>NOTE:</STRONG> If there are any controls on a dialog, all keyboard events are directed
	to the control that currently has input focus--the control that is highlighted or
	has the cursor visible in it. To capture any keyboard events in a dialog, you have
	to remove all controls from the dialog.
<HR>


</BLOCKQUOTE>


<DL>
	<DT><B></B></DT>
	<DD><B>5. </B>Open the Class Wizard. Select WM_MOUSEMOVE from the list of messages,
	and add a function by clicking the Add Function button. Click the OK button to accept
	the suggested function name.
	<P>
	<DT></DT>
	<DD><B>6. </B>Click the Edit Code button to edit the OnMouseMove function you just
	created, adding the code in Listing 3.1.
	<P>
</DL>

<H4>LISTING 3.1. THE OnMouseMove FUNCTION.</H4>
<PRE> 1: void CMouseDlg::OnMouseMove(UINT nFlags, CPoint point)
 2: {
 3:     // TODO: Add your message handler code here and/or call default
 4: 
 5:     ///////////////////////
 6:     // MY CODE STARTS HERE
 7:     ///////////////////////
 8: 
 9:     // Check to see if the left mouse button is down
10:     if ((nFlags &amp; MK_LBUTTON) == MK_LBUTTON)
11:     {
12:         // Get the Device Context
13:         CClientDC dc(this);
14: 
15:         // Draw the pixel
16:         dc.SetPixel(point.x, point.y, RGB(0, 0, 0));
17:     }
18: 
19:     ///////////////////////
20:     // MY CODE ENDS HERE
21:     ///////////////////////
22: 
23:     CDialog::OnMouseMove(nFlags, point);
24: }
</PRE>
<P>Look at the function definition at the top of the listing. You will notice that
two arguments are passed into this function. The first of these arguments is a set
of flags that can be used to determine whether a mouse button is depressed (and which
one). This determination is made in the first line of your code with the if statement:</P>
<P>
<PRE>if ((nFlags &amp; MK_LBUTTON) == MK_LBUTTON)
</PRE>
<P>In the first half of the condition being evaluated, the flags are filtered down
to the one that indicates that the left mouse button is down. In the second half,
the filtered flags are compared to the flag that indicates that the left mouse button
is down. If the two match, then the left mouse button is down.</P>
<P>The second argument to this function is the location of the mouse. This argument
gives you the coordinates on the screen where the mouse currently is. You can use
this information to draw a spot on the dialog window.</P>

<P>Before you can draw any spots on the dialog window, you need to get the device
context for the dialog window. This is done by declaring a new instance of the CClientDC
class. This class encapsulates the device context and most of the operations that
can be performed on it, including all the screen drawing operations. In a sense,
the device context is the canvas upon which you can draw with your application. Until
you have a canvas, you cannot do any drawing or painting. After the device context
object is created, you can call its SetPixel function, which colors the pixel at
the location specified in the first two arguments with the color specified in the
third argument. If you compile and run your program, you can see how it allows you
to draw on the window surface with the mouse, as shown in Figure 3.1.</P>

<P><A HREF="javascript

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久裸模| 美女视频黄 久久| 日韩国产欧美在线观看| 成人综合在线观看| 日韩欧美中文字幕一区| 亚洲欧美日韩国产综合在线| 精一区二区三区| 欧美色网站导航| 国产精品久久久久久久久果冻传媒| 三级影片在线观看欧美日韩一区二区| 成人晚上爱看视频| 欧美成人艳星乳罩| 日韩专区一卡二卡| 一本色道久久综合亚洲aⅴ蜜桃| 国产午夜精品久久| 国产一区视频网站| 日韩免费观看高清完整版在线观看| 亚洲人成电影网站色mp4| 成人av综合一区| 欧美美女视频在线观看| 亚洲欧美日本在线| 99精品1区2区| 欧美国产禁国产网站cc| 精品一区二区综合| 欧美一区二区播放| 婷婷六月综合亚洲| 欧美高清精品3d| 午夜精品aaa| 欧美巨大另类极品videosbest | 蜜臀精品一区二区三区在线观看 | 久久99久久精品欧美| 3atv一区二区三区| 午夜激情一区二区三区| 欧美日韩精品电影| 亚洲国产一二三| 91精品免费在线| 日本一不卡视频| 精品处破学生在线二十三| 美国精品在线观看| 久久久久久9999| 国产成都精品91一区二区三| 国产日韩欧美电影| 99re66热这里只有精品3直播 | 色哟哟在线观看一区二区三区| 中文字幕的久久| 成人成人成人在线视频| 亚洲视频每日更新| 欧美写真视频网站| 乱一区二区av| 中文字幕av一区二区三区免费看 | 亚洲欧美乱综合| 在线看不卡av| 久久精品国产亚洲一区二区三区| 久久欧美中文字幕| 成人av电影免费在线播放| 亚洲欧美一区二区不卡| 欧美日韩久久一区| 国产xxx精品视频大全| 中文字幕一区二区三区乱码在线| 色婷婷av一区| 强制捆绑调教一区二区| 国产欧美va欧美不卡在线| 色婷婷精品久久二区二区蜜臀av| 日韩精品每日更新| 亚洲国产岛国毛片在线| 欧美日韩大陆一区二区| 激情五月婷婷综合网| 综合久久给合久久狠狠狠97色 | 欧美一级淫片007| 麻豆精品一区二区综合av| 久久久www免费人成精品| 色综合色综合色综合色综合色综合| 视频一区在线视频| 中文字幕不卡在线| 6080国产精品一区二区| 成人网在线播放| 日韩av不卡一区二区| 国产日韩三级在线| 欧美欧美午夜aⅴ在线观看| 国产91丝袜在线观看| 一区二区三区四区蜜桃| 国产婷婷一区二区| 日韩免费观看高清完整版| 99re6这里只有精品视频在线观看| 久久精品国内一区二区三区| 亚洲欧美激情一区二区| 久久久亚洲精华液精华液精华液| 91免费看片在线观看| 国产精品资源网| 久久狠狠亚洲综合| 亚洲国产精品久久一线不卡| 国产精品网站一区| 久久婷婷色综合| 日韩精品中午字幕| 6080国产精品一区二区| 欧美性极品少妇| 色综合天天做天天爱| 不卡视频在线看| 国产精品一区二区免费不卡 | 欧美久久久久免费| 欧美性一区二区| 99国产一区二区三精品乱码| 狠狠色丁香婷婷综合久久片| 日日噜噜夜夜狠狠视频欧美人 | 亚洲黄色免费电影| 亚洲欧洲精品成人久久奇米网| 精品国免费一区二区三区| 欧美精品一二三| 欧美日韩国产高清一区| 日本韩国视频一区二区| 91伊人久久大香线蕉| 成人午夜电影小说| 国产福利91精品一区二区三区| 国产一区二区三区电影在线观看 | 91蜜桃传媒精品久久久一区二区| 国产suv一区二区三区88区| 国产精品白丝jk黑袜喷水| 国产剧情一区二区| 成人aaaa免费全部观看| bt欧美亚洲午夜电影天堂| 一本一道综合狠狠老| 日本韩国视频一区二区| 欧美日韩在线综合| 欧美精选一区二区| 欧美成人精品福利| 国产欧美日韩视频在线观看| 国产欧美一区二区三区沐欲| 中文字幕一区二区三区不卡在线| 亚洲精选一二三| 日韩专区中文字幕一区二区| 麻豆精品一区二区综合av| 国产精品一品视频| 色综合天天狠狠| 欧美久久久久久久久中文字幕| 日韩视频免费观看高清完整版| 2欧美一区二区三区在线观看视频| 久久嫩草精品久久久久| 亚洲欧洲日韩一区二区三区| 亚洲亚洲精品在线观看| 麻豆成人久久精品二区三区小说| 国产一区三区三区| 91网站在线观看视频| 欧美日本在线观看| 久久久久亚洲蜜桃| 亚洲人成亚洲人成在线观看图片 | 欧美日韩在线播放三区| 日韩免费高清av| 亚洲日本免费电影| 秋霞成人午夜伦在线观看| 成人免费精品视频| 欧美猛男gaygay网站| 欧美激情一区二区三区四区| 亚洲无人区一区| 国产精品亚洲第一| 欧美日韩国产小视频| 国产欧美日韩精品a在线观看| 亚洲一区在线观看免费观看电影高清| 青青草97国产精品免费观看无弹窗版| 成人性生交大片免费看中文| 4438成人网| 亚洲欧美综合另类在线卡通| 免费的国产精品| 色综合夜色一区| 久久精品一区四区| 奇米影视一区二区三区小说| 91老司机福利 在线| 久久蜜桃av一区二区天堂| 亚洲五码中文字幕| 99精品久久只有精品| 久久久综合激的五月天| 首页亚洲欧美制服丝腿| 不卡一区中文字幕| 国产日韩高清在线| 久久国产人妖系列| 91精品国产aⅴ一区二区| 亚洲精品久久久久久国产精华液| 国产精品夜夜爽| 精品黑人一区二区三区久久| 五月综合激情婷婷六月色窝| 色综合久久综合中文综合网| 国产欧美日韩在线观看| 韩国v欧美v日本v亚洲v| 在线91免费看| 亚洲一区二区免费视频| 91行情网站电视在线观看高清版| 中文字幕国产一区二区| 国产成人精品免费| 久久久久久久性| 国产麻豆9l精品三级站| 精品国产乱码久久久久久蜜臀| 婷婷夜色潮精品综合在线| 欧美色精品天天在线观看视频| 亚洲激情图片一区| 在线观看成人小视频| 一区二区三区.www| 欧美亚洲国产一区二区三区| 亚洲永久免费视频| 欧美日韩不卡在线| 蜜臀99久久精品久久久久久软件| 日韩一级欧美一级|