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

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

?? ch03.htm

?? 有關Visual C++ 6.0 編程實例與技巧方面的相關資料
?? 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一区二区三区免费野_久草精品视频
欧美日韩不卡在线| 日本特黄久久久高潮| 91精品国产综合久久香蕉麻豆| av高清不卡在线| 国产成人av一区二区三区在线| 精品一区二区三区免费毛片爱| 日本美女视频一区二区| 成人涩涩免费视频| 99久久综合99久久综合网站| 国产真实乱偷精品视频免| 激情综合色播五月| 91蜜桃传媒精品久久久一区二区| 99re视频精品| 久久综合久久综合久久| 久久久www成人免费无遮挡大片| 欧美激情在线一区二区三区| 亚洲欧洲日韩av| 亚洲成a天堂v人片| 久久国产精品免费| a美女胸又www黄视频久久| 精品日韩一区二区三区| 欧美激情在线免费观看| 看国产成人h片视频| 欧美二区在线观看| 久久久久久久久97黄色工厂| 丝瓜av网站精品一区二区| 国产麻豆成人精品| 欧美性高清videossexo| 精品国产一二三| 亚洲三级在线免费观看| 毛片av中文字幕一区二区| 成人免费黄色大片| 久久久久久久性| 久草在线在线精品观看| 日韩亚洲欧美综合| 亚洲欧洲国产专区| av亚洲产国偷v产偷v自拍| 国产色产综合色产在线视频| 性感美女久久精品| 欧美午夜电影网| 亚洲一区二区视频在线| 国产91精品露脸国语对白| 欧美日韩日日摸| 国产日韩欧美在线一区| 日韩激情视频在线观看| 日韩欧美一级片| 亚洲人成在线播放网站岛国| 国内精品久久久久影院色| 精品乱人伦一区二区三区| 极品瑜伽女神91| 久久亚洲精品国产精品紫薇| 丁香婷婷综合色啪| 日韩美女久久久| 欧美四级电影在线观看| 日本成人中文字幕| 亚洲精品一区二区三区影院 | 日韩三级在线观看| 麻豆精品精品国产自在97香蕉| 精品国产一区久久| 成人小视频在线观看| 亚洲免费观看在线视频| 在线成人av网站| 久草精品在线观看| 中文字幕成人在线观看| 欧美中文字幕一二三区视频| 国产精品视频线看| 国产剧情一区二区三区| 精品国产一二三区| 99久久精品费精品国产一区二区| 亚洲主播在线观看| 久久久久久久国产精品影院| 91欧美一区二区| 蜜桃视频在线一区| 亚洲人亚洲人成电影网站色| 欧美巨大另类极品videosbest| 精品一二三四区| 亚洲一区中文在线| 欧美精品一区二区三区久久久| 91网站最新地址| 精品无人码麻豆乱码1区2区| 中文字幕一区二区三| 日韩一区二区免费电影| 97久久超碰精品国产| 久草精品在线观看| 一二三区精品视频| 欧美日韩成人综合| 国产69精品久久99不卡| 日韩高清不卡一区| 中文一区在线播放| 日韩欧美一区二区视频| 色偷偷久久人人79超碰人人澡| 一区二区三区在线免费视频| 久久精品一区二区三区不卡| 欧美性猛交xxxx黑人交| 成人的网站免费观看| 一区二区三区视频在线观看| 国产视频亚洲色图| 日韩一区二区免费在线电影| 在线看不卡av| zzijzzij亚洲日本少妇熟睡| 国内精品国产成人国产三级粉色| 午夜精品久久久久久| 精品毛片乱码1区2区3区| 欧美日韩国产综合久久| 色噜噜狠狠色综合中国| 日本亚洲一区二区| 亚洲第一激情av| 依依成人综合视频| 欧美大片国产精品| 欧美精品免费视频| 欧美日韩在线电影| 欧美色图激情小说| 欧美写真视频网站| 欧美亚一区二区| 欧洲精品一区二区三区在线观看| 99精品偷自拍| 91视频.com| 色综合天天综合色综合av| 国产精品1区2区3区在线观看| 日韩电影在线看| 日本不卡一二三区黄网| 国产精品日日摸夜夜摸av| 日本一区二区三区在线观看| 国产欧美一区二区精品忘忧草| 欧美精品一区二区久久久| 精品国产亚洲一区二区三区在线观看| 日韩三级视频中文字幕| 欧美岛国在线观看| 亚洲精品一区二区精华| 久久九九影视网| 亚洲国产精品av| 亚洲人成亚洲人成在线观看图片| 亚洲欧美激情一区二区| 夜夜精品浪潮av一区二区三区| 亚洲高清免费一级二级三级| 国产精品日日摸夜夜摸av| 日韩一区中文字幕| 亚洲综合丝袜美腿| 日本在线播放一区二区三区| 老色鬼精品视频在线观看播放| 韩国av一区二区| av网站一区二区三区| 在线观看精品一区| 欧美一级二级在线观看| 国产色产综合色产在线视频| 中文字幕一区二区三区不卡| 午夜视频久久久久久| 国精产品一区一区三区mba桃花| 99视频热这里只有精品免费| 欧美三级日本三级少妇99| 日韩丝袜美女视频| 国产精品国产三级国产a| 国产亚洲一区二区三区四区| 综合久久综合久久| 人禽交欧美网站| av电影一区二区| 日韩午夜激情视频| 成人免费一区二区三区在线观看| 五月婷婷综合激情| 国产成人av电影免费在线观看| 91激情五月电影| 精品国产电影一区二区| 亚洲美女电影在线| 久久超碰97中文字幕| 91丨九色porny丨蝌蚪| 日韩三级在线观看| 一区二区三区精品在线观看| 国内外成人在线视频| 91福利视频在线| 国产三级久久久| 日韩二区三区四区| 97se亚洲国产综合在线| 精品91自产拍在线观看一区| 亚洲一区视频在线观看视频| 国产精品亚洲成人| 欧美一区二区三区在线观看| 日韩欧美国产午夜精品| 亚洲精品第1页| 国产成人在线色| 精品国产免费一区二区三区香蕉 | 91精品国产色综合久久| 亚洲色图都市小说| 国产成人丝袜美腿| 日韩免费电影一区| 日日夜夜精品视频免费| 色就色 综合激情| 国产精品免费aⅴ片在线观看| 久久国内精品视频| 91精品国产综合久久福利软件 | 欧美综合视频在线观看| 国产精品美女一区二区| 精品一区二区三区在线播放| 欧美人牲a欧美精品| 一区二区三区四区蜜桃| av动漫一区二区| 亚洲欧洲av在线| 成人av在线资源网| 中文字幕中文字幕中文字幕亚洲无线| 国内成人自拍视频| 久久免费精品国产久精品久久久久|