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

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

?? ch14.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<H4><FONT COLOR="#000077">Changes to the CAboutDlg Class</FONT></H4><P>Add two new variables to the <TT>CAboutDlg</TT> class. These variables are usedto store the handles to icons displayed on the dialog box buttons. Add the sourcecode from Listing 14.1 to the Implementation section of the <TT>CAboutDlg</TT> project.Also, add a declaration for a destructor for the <TT>CAboutDlg</TT> class, just afterthe constructor declaration.<H4><FONT COLOR="#000077">TYPE: Listing 14.1. Additions to the CAboutDlg class declaration.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>// Implementation</TT><TT>public:</TT><TT>    &quot;CAboutDlg();</TT><TT>protected:</TT><TT>    HICON   m_hIconOkay;</TT><TT>    HICON   m_hIconCancel;</TT></FONT></PRE><P>The icons are added to the dialog box's buttons when the dialog box receives the<TT>WM_INITDIALOG</TT> message. Using ClassWizard, add a message-handling functionfor <TT>WM_INITDIALOG</TT> to the <TT>CAboutDlg</TT> class. Use the default nameprovided by ClassWizard, <TT>OnInitDialog</TT>. Edit the <TT>OnInitDialog</TT> memberfunction so it looks like the code provided in Listing 14.2.<H4><FONT COLOR="#000077">TYPE: Listing 14.2. The AboutDlg::OnInitDialog member function.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>BOOL CAboutDlg::OnInitDialog()</TT><TT>{</TT><TT>    CDialog::OnInitDialog();</TT><TT>    CWinApp* pApp = AfxGetApp();</TT><TT>    if( pApp != 0 )</TT><TT>    {</TT><TT>        m_hIconOkay = pApp-&gt;LoadIcon( IDI_GREEN );</TT><TT>        m_hIconCancel = pApp-&gt;LoadIcon( IDI_RED );</TT><TT>        ASSERT(m_hIconOkay);</TT><TT>        ASSERT(m_hIconCancel);</TT><TT>        m_btnOkay.SetIcon( m_hIconOkay );</TT><TT>        m_btnCancel.SetIcon( m_hIconCancel );</TT><TT>    }</TT><TT>    return TRUE;</TT><TT>}</TT></FONT></PRE><P>The source code in Listing 14.2 loads the two stop-light icons created earlier.After the icons are loaded, the icon handles are passed to the <TT>SetIcon</TT> functionfor each of the buttons contained in the dialog box.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>When an icon is	drawn on a button, the icon is clipped if necessary. The icon isn't scaled to fit	inside the button; it is displayed &quot;actual size.&quot; This might mean that	you must experiment with the relative sizes of the icon and the button. <HR></BLOCKQUOTE><P>As the dialog box is destroyed, the icons previously loaded using <TT>LoadIcon</TT>must be destroyed. Use the source code from Listing 14.3 to create the <TT>CAboutDlg</TT>class destructor.<H4><FONT COLOR="#000077">TYPE: Listing 14.3. Using the CAboutDlg class destructorto destroy the previously loaded icons.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>CAboutDlg::&quot;CAboutDlg()</TT><TT>{</TT><TT>    DestroyIcon( m_hIconOkay );</TT><TT>    DestroyIcon( m_hIconCancel );</TT><TT>}</TT></FONT></PRE><P>Compile and run the DCTest example. Figure 14.3 shows the DCTest About box withicons placed in the pushbutton controls.</P><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 14.3.</B> </A><I><BR>The DCTest dialog box after adding icons to the pushbutton controls.</I><H2><FONT COLOR="#000077"><B>What Is a Cursor?</B></FONT></H2><P>A cursor is the little bitmap that moves around the screen providing feedbackabout the current mouse position. The cursor also provides other types of feedback:<UL>	<LI>If the application is busy and won't accept input, most applications change the	regular cursor to the hourglass cursor.<BR>	<BR>		<LI>If the cursor is over a window or control that accepts text input, most applications	change the regular cursor to the I-beam cursor.</UL><P>The most commonly used cursors are supplied by Windows. The hourglass, I-beam,and arrow cursors are three of the more popular standard cursors. In addition, eachprogram can define cursors that you add to the application just as you do other resources.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>The cursor is an	important part of the feedback supplied to a user of a Windows program. Changing	the style of cursor is an easy way to alert the user that a change of some type has	occurred. Many times, changing the cursor is the only type of feedback required.	<HR></BLOCKQUOTE><H2><FONT COLOR="#000077"><B>Using Cursors in Windows Programs</B></FONT></H2><P>Most window classes have a cursor assigned to the class. In almost all cases,it's the standard arrow cursor. This means that for most default behavior, you don'thave to do anything to use a cursor; Windows provides it free of charge. However,there are some situations in which you must take control over the cursor yourself.For the examples in this hour, you create an SDI project named Cursor.<H3><FONT COLOR="#000077"><B>Creating a Cursor Resource</B></FONT></H3><P>You create a cursor image using the Developer Studio image editor, much like iconswere created earlier this hour. Figure 14.4 shows the cursor used in later examplesready for editing in the image editor.</P><P>Create the cursor shown in Figure 14.4 and name it <TT>IDC_BANG</TT>. To createa cursor resource, right-click in the resource view window and choose Insert... fromthe pop-up menu; then select Cursor from the Resource Type dialog box. The editingtools you use to create a cursor are the same ones you used to create icons earlierin this hour. The standard Windows naming convention is for cursors to have namesbeginning with <TT>IDC_</TT>.<H3><FONT COLOR="#000077"><B>Adding a Hotspot to a Cursor</B></FONT></H3><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>hotspot</I> is the actualpoint that determines the current cursor position.</P><P>Every cursor has a hotspot. The hotspot for the arrow cursor is located at thevery tip of the arrow. The default hotspot for a cursor is the upper-left cornerof the cursor. The cursor-image editor enables you to move the hotspot to a positionthat is reasonable for the cursor image.</P><P><A NAME="04"></A><A HREF="04.htm"><B>Figure 14.4.</B> </A><I><BR>The <TT>IDC_BANG</TT> cursor inside the Developer Studio image editor.</I></P><P>For example, the <TT>IDC_BANG</TT> cursor you created in the previous sectionwill not work properly if a new hotspot isn't defined. Because the current hotspotis part of the background, this cursor won't work as well for operations in whichthe mouse clicks must be accurate. One solution, as shown in Figure 14.5, is to modifythe cursor to add a well-defined hotspot to the cursor--in this case a bull's-eye,or target, in the upper-left corner of the cursor bitmap.</P><P><A NAME="05"></A><A HREF="05.htm"><B>Figure 14.5.</B> </A><I><BR>The new version of <TT>IDC_BANG</TT>, with a hotspot and a bull's-eye.</I></P><P>The hotspot control is a button located above the edited image. Click the hotspotbutton and then click the new hotspot pixel. For <TT>IDC_BANG</TT>, create a newhotspot in the center of the bull's-eye.<H3><FONT COLOR="#000077"><B>Changing a Cursor</B></FONT></H3><P>Changing the current mouse cursor is probably the most common cursor-related activityin Windows programming. The operating system sends a <TT>WM_SETCURSOR</TT> messageto a window as the mouse cursor passes over it. You can use this message to changethe cursor, or you can let Windows choose the cursor that was defined for the windowwhen it was registered.</P><P>To change the current cursor for a window, you handle the <TT>WM_SETCURSOR</TT>message. Using ClassWizard, add a message-handling function for <TT>WM</TT>_<TT>SETCURSOR</TT>to the <TT>CAboutDlg</TT> class. Listing 14.4 contains source code for <TT>OnSetCursor</TT>that changes the cursor to <TT>IDC_BANG</TT>.<H4><FONT COLOR="#000077">TYPE: Listing 14.4. Changing the cursor during WM_SETCURSOR.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest,</TT><TT>                            UINT message)</TT><TT>{</TT><TT>    // Load and set the new cursor. Return TRUE to stop</TT><TT>    // further processing of this message.</TT><TT>    CWinApp* pApp = AfxGetApp();</TT><TT>    HICON hIconBang = pApp-&gt;LoadCursor( IDC_BANG );</TT><TT>    SetCursor( hIconBang );</TT><TT>    return TRUE;</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Conditionally Changing a Cursor</B></FONT></H3><P>Changing a cursor conditionally is often convenient, based on the cursor's location.Listing 14.5 is a new version of <TT>OnSetCursor</TT> that restores the arrow cursorwhen the cursor is over the dialog box's OK button.<H4><FONT COLOR="#000077">TYPE: Listing 14.5. Conditionally changing the cursor duringWM_SETCURSOR.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>BOOL CAboutDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest,</TT><TT>                            UINT message)</TT><TT>{</TT><TT>    BOOL    bReturn;</TT><TT>    CRect   rcBtn;</TT><TT>    CPoint  ptCursor;</TT><TT>    //</TT><TT>    // Calculate the current cursor position, and change the</TT><TT>    // cursor if we're not over the OK button.</TT><TT>    //</TT><TT>    CWnd*   pBtn = GetDlgItem( IDOK );</TT><TT>    pBtn-&gt;GetWindowRect( rcBtn );</TT><TT>    GetCursorPos( &amp;ptCursor );</TT><TT>    if( rcBtn.PtInRect( ptCursor ) == FALSE )</TT><TT>    {</TT><TT>        // Load and set the new cursor. Return TRUE to stop</TT><TT>        // further processing of this message.</TT><TT>        CWinApp* pApp = AfxGetApp();</TT><TT>        HICON hIconBang = pApp-&gt;LoadCursor( IDC_BANG );</TT><TT>        SetCursor( hIconBang );</TT><TT>        bReturn = TRUE;</TT><TT>    }</TT><TT>    else</TT><TT>    {</TT><TT>        // We're over the OK button, use the default cursor.</TT><TT>        bReturn = CDialog::OnSetCursor(pWnd, nHitTest, message);</TT><TT>    }</TT><TT>    return bReturn;</TT><TT>}</TT></FONT></PRE><P>The two key lines in Listing 14.5 retrieve the current mouse cursor position asa <TT>CPoint</TT> object. The <TT>CPoint</TT> object is tested to see whether itis inside the boundary of the OK pushbutton:</P><PRE><FONT COLOR="#0066FF"><TT>GetCursorPos( &amp;ptCursor );</TT><TT>if( rcBtn.PtInRect( ptCursor ) == FALSE )</TT><TT>{</TT><TT>    // cursor not over rectangle</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Using the Standard Cursors</B></FONT></H3><P>Windows provides 19 standard cursors for use in your programs. These cursors oftenare used by Windows. For example, the <TT>IDC_APPSTARTING</TT> cursor is displayedwhen an application is launched by Windows. Table 14.2 lists the names and descriptionsof the 19 standard cursors.<H4><FONT COLOR="#000077">Table 14.2. The standard cursors provided by Windows.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>Cursor Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Description</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_ARROW</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Arrow cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_IBEAM</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">I-beam cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_WAIT</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Hourglass cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_CROSS</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Crosshair cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_UPARROW</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Up-arrow cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SIZENWSE</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Sizing cursor, points northwest and southeast</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SIZENESW</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Sizing cursor, points northeast and southwest</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SIZEWE</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Sizing cursor, points west and east</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SIZENS</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Sizing cursor, points north and south</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_SIZEALL</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Sizing cursor, points north, south, east, and west</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_NO</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">&quot;No&quot; cursor (circle with a slash through it)</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_APPSTARTING</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Application-starting cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDC_HELP</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Help cursor</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDI_APPLICATION</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">Application icon</TD>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频一二区| 亚洲欧洲一区二区在线播放| 在线观看一区不卡| 99久久99精品久久久久久| 成人免费视频视频在线观看免费 | 日韩一区欧美一区| 国产精品丝袜久久久久久app| 国产日产亚洲精品系列| 国产日产欧美一区二区三区| 中文字幕乱码一区二区免费| 国产精品乱码人人做人人爱| 自拍偷拍国产精品| 亚洲一区二区在线免费看| 亚洲午夜久久久| 日本视频中文字幕一区二区三区| 美国毛片一区二区三区| 国产成人综合亚洲网站| 波多野结衣的一区二区三区| 色哟哟国产精品| 91精品在线观看入口| 久久久久亚洲综合| 自拍视频在线观看一区二区| 亚洲va欧美va国产va天堂影院| 美女视频网站久久| 成人激情午夜影院| 欧美狂野另类xxxxoooo| 欧美精品一区二区三区视频| 精品久久久久久久久久久久久久久| 国产视频视频一区| 亚洲综合免费观看高清完整版在线 | 欧美aⅴ一区二区三区视频| 极品尤物av久久免费看| 91视频国产资源| 26uuu国产一区二区三区 | 在线中文字幕一区| 91精品欧美一区二区三区综合在| 久久久久久免费网| 亚洲一区二区三区四区五区黄| 另类的小说在线视频另类成人小视频在线| 懂色av中文一区二区三区| 欧美日韩亚洲另类| 中文字幕av一区 二区| 丝袜亚洲另类丝袜在线| 成人不卡免费av| 欧美mv和日韩mv的网站| 亚洲尤物在线视频观看| 国产不卡一区视频| 欧美一级电影网站| 亚洲一卡二卡三卡四卡五卡| 国产91综合一区在线观看| 欧美日韩日日骚| 最好看的中文字幕久久| 国产成人超碰人人澡人人澡| 欧美人与禽zozo性伦| 久久久一区二区| 日本成人中文字幕在线视频| 色吧成人激情小说| 国产精品久久99| 国产91丝袜在线播放| 久久综合九色欧美综合狠狠| 日韩精品电影一区亚洲| 91黄色免费版| 亚洲美女免费视频| 99综合影院在线| 久久中文字幕电影| 精品一区二区三区不卡| 日韩一区二区三免费高清| 石原莉奈在线亚洲二区| 欧美日韩一区小说| 五月天视频一区| 欧美日韩亚洲另类| 日韩国产高清影视| 在线观看91av| 美女视频免费一区| 精品国产伦一区二区三区观看体验| 日韩av一区二区在线影视| 欧美精品丝袜中出| 日本一区中文字幕| 欧美一级二级三级乱码| 精品一区二区av| 久久久电影一区二区三区| 懂色av一区二区夜夜嗨| 国产欧美日韩精品a在线观看| 国产传媒日韩欧美成人| 日本一区二区电影| 色香蕉成人二区免费| 奇米影视在线99精品| 激情偷乱视频一区二区三区| 91福利视频网站| 性做久久久久久免费观看| 91麻豆精东视频| 日韩精品一区二| 亚洲欧美日韩系列| 久久久久免费观看| 制服丝袜亚洲播放| 91麻豆国产福利精品| 高清日韩电视剧大全免费| 美女视频黄免费的久久| 视频一区二区三区中文字幕| 亚洲综合丝袜美腿| 亚洲精品v日韩精品| 欧美国产成人精品| 国产欧美一区二区精品忘忧草| 日韩三区在线观看| 欧美体内she精高潮| 色噜噜狠狠成人中文综合| 91香蕉视频黄| 99精品久久99久久久久| 94-欧美-setu| 色嗨嗨av一区二区三区| 色悠悠久久综合| 色综合亚洲欧洲| 91女厕偷拍女厕偷拍高清| 成人高清视频在线观看| 成人av资源站| 91首页免费视频| 在线观看不卡一区| 这里只有精品免费| 欧美一区二区国产| 欧美va亚洲va香蕉在线| 久久人人97超碰com| 久久久精品国产免大香伊| 国产精品青草久久| 亚洲黄色尤物视频| 天天综合网天天综合色| 日韩**一区毛片| 激情综合网激情| 成人18视频在线播放| 在线一区二区视频| 欧美一区二区三区四区久久| 日韩视频免费直播| 日本一二三四高清不卡| 一区二区三区高清不卡| 性做久久久久久久免费看| 老司机精品视频一区二区三区| 国产高清精品在线| 色综合激情五月| 欧美一区二区在线播放| 国产亚洲污的网站| 亚洲精品五月天| 美脚の诱脚舐め脚责91| 成人app软件下载大全免费| 欧美日韩日日摸| 国产午夜精品一区二区| 亚洲免费资源在线播放| 美女视频黄久久| 97久久人人超碰| 精品国一区二区三区| 一区二区三区在线不卡| 久久99精品国产91久久来源| 91影院在线观看| 欧美va亚洲va香蕉在线| 亚洲乱码一区二区三区在线观看| 日韩国产欧美三级| eeuss鲁片一区二区三区 | 欧美激情中文字幕| 亚洲成人福利片| 成人激情校园春色| 欧美一区二区免费观在线| 亚洲欧美综合另类在线卡通| 奇米777欧美一区二区| av在线不卡观看免费观看| 日韩一区二区三区四区五区六区| 国产精品国产三级国产普通话99| 日本中文在线一区| 在线免费观看日韩欧美| 国产精品青草久久| 国产一区二区女| 欧美人妇做爰xxxⅹ性高电影| 国产精品天美传媒| 国产一区在线精品| 欧美一区二区三区在线电影| 亚洲女与黑人做爰| 国产白丝网站精品污在线入口| 91麻豆精品国产91久久久资源速度| 亚洲欧洲在线观看av| 国产福利一区在线| 精品国产伦一区二区三区免费| 午夜欧美大尺度福利影院在线看| 99久久国产综合色|国产精品| 国产日韩欧美一区二区三区综合| 日本sm残虐另类| 欧美日韩在线三级| 亚洲国产欧美在线| 欧美在线一二三| 一区二区视频在线| 91免费观看视频在线| 国产精品国产三级国产aⅴ原创| 韩国一区二区视频| 日韩美女一区二区三区| 奇米影视一区二区三区小说| 欧美精品久久天天躁| 午夜成人免费视频| 宅男噜噜噜66一区二区66| 视频一区视频二区中文| 337p亚洲精品色噜噜| 免费一级欧美片在线观看| 日韩欧美国产不卡| 精品亚洲aⅴ乱码一区二区三区| 欧美mv和日韩mv的网站|