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

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

?? ch03.htm

?? 21天學會VC的英文版
?? 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小宝寻花一区二区三区| 欧美午夜宅男影院| 久久久夜色精品亚洲| 亚洲一区免费观看| 懂色一区二区三区免费观看| 欧美高清视频一二三区| 亚洲欧美国产77777| 国产一区视频网站| 日韩一区二区三区电影| 亚洲一区二区三区小说| www.性欧美| 欧美激情中文不卡| 久久 天天综合| 欧美日韩精品欧美日韩精品一| 18成人在线视频| 久草这里只有精品视频| 7777精品伊人久久久大香线蕉经典版下载 | 欧美aaa在线| 91国产成人在线| 国产精品久久毛片a| 国产精品亚洲视频| 久久亚洲精精品中文字幕早川悠里| 亚洲成a人在线观看| 日本道精品一区二区三区| 亚洲色图欧美偷拍| 99这里只有久久精品视频| 国产片一区二区三区| 国产一区二区精品久久| 亚洲精品在线电影| 寂寞少妇一区二区三区| 久久综合九色综合欧美98| 国产在线观看一区二区| 精品国产免费一区二区三区四区| 免费人成黄页网站在线一区二区| 日韩一区二区三区免费观看| 久久精品国产网站| 久久综合九色综合97婷婷女人| 国产一区二区三区高清播放| 久久―日本道色综合久久| 国产在线精品一区在线观看麻豆| 欧美精品一区二区三区视频| 国产成人精品免费视频网站| 久久亚洲精品小早川怜子| 丰满岳乱妇一区二区三区| 国产精品免费久久| 色哟哟一区二区在线观看| 亚洲影视在线播放| 色婷婷综合激情| 一区二区三区不卡在线观看| 欧美人与z0zoxxxx视频| 麻豆成人久久精品二区三区红| 欧美成人精品高清在线播放| 国产裸体歌舞团一区二区| 国产精品久久久久久久久果冻传媒 | 成人午夜私人影院| 中文字幕中文字幕中文字幕亚洲无线| 99热99精品| 亚洲图片一区二区| 91精品国产综合久久久久久久| 久久激情综合网| 国产日韩欧美精品综合| zzijzzij亚洲日本少妇熟睡| 亚洲国产日日夜夜| 26uuu亚洲| 色婷婷av一区二区三区gif | 91福利视频久久久久| 日本va欧美va精品| 国产日韩欧美电影| 欧美亚洲国产一区二区三区va| 肉色丝袜一区二区| 欧美极品xxx| 欧美日韩激情一区二区| 国产一区在线精品| 亚洲成人动漫精品| 国产亚洲一本大道中文在线| 日本黄色一区二区| 国产一区在线精品| 午夜欧美视频在线观看| 国产视频亚洲色图| 69久久夜色精品国产69蝌蚪网| 国产suv一区二区三区88区| 亚洲成人综合在线| 欧美激情一区三区| 日韩欧美国产午夜精品| 色综合一区二区三区| 久久国产福利国产秒拍| 亚洲一区二区三区三| 久久久精品免费网站| 欧美日韩aaaaa| 不卡av在线免费观看| 韩日欧美一区二区三区| 天天操天天色综合| 亚洲欧美二区三区| 中文字幕第一页久久| 日韩欧美美女一区二区三区| 欧美综合视频在线观看| av网站一区二区三区| 国产乱码字幕精品高清av| 日本不卡123| 偷拍自拍另类欧美| 亚洲综合一二区| 中文字幕亚洲一区二区va在线| 久久久久久日产精品| 欧美成人乱码一区二区三区| 欧美一级夜夜爽| 91.xcao| 欧美日韩日日骚| 欧美日韩精品一区二区三区 | 日本午夜精品视频在线观看| 一区二区欧美国产| 日韩毛片在线免费观看| 日本一区二区三区电影| 国产欧美日韩在线视频| 久久久亚洲精品一区二区三区 | 91麻豆精品国产无毒不卡在线观看| 色久综合一二码| 91片黄在线观看| 91啪亚洲精品| 在线免费一区三区| 欧美在线free| 欧美日韩国产美| 日韩一级免费观看| 日韩精品一区二区三区老鸭窝| 日韩美一区二区三区| 2023国产精品视频| 欧美国产精品劲爆| 自拍视频在线观看一区二区| 亚洲精品日日夜夜| 亚洲成人激情av| 麻豆视频一区二区| 国产精品亚洲а∨天堂免在线| 国产宾馆实践打屁股91| 99精品视频在线观看| 欧美在线影院一区二区| 8v天堂国产在线一区二区| 欧美电影免费观看高清完整版在线| 久久五月婷婷丁香社区| 国产精品视频一二三| 亚洲自拍偷拍麻豆| 另类的小说在线视频另类成人小视频在线| 免费欧美高清视频| 国产成人免费视频一区| 色婷婷国产精品久久包臀| 91精品在线免费观看| 久久久亚洲综合| 亚洲伊人色欲综合网| 国内精品自线一区二区三区视频| 国产91精品免费| 91成人免费网站| 久久一夜天堂av一区二区三区| 亚洲日本免费电影| 日本成人中文字幕| 成人午夜视频网站| 欧美伦理视频网站| 国产欧美日韩另类视频免费观看| 亚洲精品中文字幕乱码三区| 久色婷婷小香蕉久久| 99久久777色| 欧美大胆人体bbbb| 亚洲欧美日韩在线| 国产一区二区三区在线看麻豆| 91影院在线免费观看| 日韩一区二区免费在线电影| 亚洲日本护士毛茸茸| 久久99久久久欧美国产| 欧洲另类一二三四区| 久久蜜桃一区二区| 三级欧美韩日大片在线看| 91美女精品福利| 久久久久九九视频| 免费成人在线影院| 欧美在线一二三四区| 国产精品色呦呦| 老司机精品视频一区二区三区| 91免费在线看| 欧美精彩视频一区二区三区| 免费黄网站欧美| 欧美日韩一级二级三级| 亚洲素人一区二区| 成人免费视频一区| 久久精品亚洲精品国产欧美kt∨ | 欧美国产日韩精品免费观看| 秋霞av亚洲一区二区三| 欧美天堂一区二区三区| 亚洲欧美色综合| 99精品欧美一区| 日本一区免费视频| 久久99久久久欧美国产| 欧美一级二级三级乱码| 天天综合网天天综合色| 欧美三区在线观看| 亚洲一区二区在线播放相泽| 色狠狠桃花综合| 一区二区高清在线| 色哟哟亚洲精品| 亚洲精品免费视频| 在线观看日韩国产| 亚洲资源在线观看|