⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 278-282.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
	</tr>
	</table>
	</form>
<!-- LEFT NAV SEARCH END -->

		</td>
		
<!-- PUB PARTNERS END -->
<!-- END LEFT NAV -->

<td rowspan="8" align="right" valign="top"><img src="/images/iswbls.gif" width=1 height=400 alt="" border="0"></td>
<td><img src="/images/white.gif" width="5" height="1" alt="" border="0"></td>
<!-- end of ITK left NAV -->

<!-- begin main content -->
<td width="100%" valign="top" align="left">


<!-- END SUB HEADER -->

<!--Begin Content Column -->

<FONT FACE="Arial,Helvetica" SIZE="-1">
To access the contents, click the chapter and section titles.
</FONT>
<P>
<B>Essential Windows CE Application Programming</B>
<FONT SIZE="-1">
<BR>
<I>(Publisher: John Wiley & Sons, Inc.)</I>
<BR>
Author(s): Robert Burdick
<BR>
ISBN: 0471327476
<BR>
Publication Date: 03/01/99
</FONT>
<P>
<form name="Search" method="GET" action="http://search.earthweb.com/search97/search_redir.cgi">

<INPUT TYPE="hidden" NAME="Action" VALUE="Search">
<INPUT TYPE="hidden" NAME="SearchPage" VALUE="http://search.earthweb.com/search97/samples/forms/srchdemo.htm">
<INPUT TYPE="hidden" NAME="Collection" VALUE="ITK">
<INPUT TYPE="hidden" NAME="ResultTemplate" VALUE="itk-simple-intrabook.hts">
<INPUT TYPE="hidden" NAME="ViewTemplate" VALUE="view.hts">

<font face="arial, helvetica" size=2><b>Search this book:</b></font><br>
<INPUT NAME="queryText" size=50 VALUE="">&nbsp;<input type="submit" name="submitbutton" value="Go!">
<INPUT type=hidden NAME="section_on" VALUE="on">
<INPUT type=hidden NAME="section" VALUE="http://www.itknowledge.com/reference/standard/0471327476/">

</form>


<!-- Empty Reference Subhead -->

<!--ISBN=0471327476//-->
<!--TITLE=Essential Windows CE Application Programming//-->
<!--AUTHOR=Robert Burdick//-->
<!--PUBLISHER=John Wiley & Sons, Inc.//-->
<!--IMPRINT=Wiley Computer Publishing//-->
<!--CHAPTER=10//-->
<!--PAGES=278-282//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="275-278.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="282-285.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><I>dwDrawStage</I> can also inform the parent window where the control is in the process of drawing individual items within the control. For example, a list view control keeps its parent apprised of the drawing progress for each list view item that is drawn. Trackbar controls tell their parents about trackbar thumb, channel, and tic mark drawing progress. The four possible values of <I>dwDrawStage</I> that convey this information are:</P>
<DL>
<DD><B>CDDS_ITEMPREPAINT.</B> Sent before a control item is painted.
<DD><B>CDDS_ITEMPOSTPAINT.</B> Sent after a control item is painted.
<DD><B>CDDS_ITEMPREERASE.</B> Sent before a control item is erased. Not currently supported.
<DD><B>CDDS_ITEMPOSTERASE.</B> Sent after a control item is erased. Not currently supported.
</DL>
<P>Note that CDDS_ITEMPREERASE and CDDS_ITEMPOSTERASE are not currently supported.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>C<SMALL>USTOM</SMALL> D<SMALL>RAW</SMALL> N<SMALL>OTIFICATIONS</SMALL></B>
<P><B>All custom draw service information comes to a control&#146;s parent window via the WM_NOTIFY message. This is the way that all common control notifications get to parent windows. But common controls can specify a variety of notification codes when they send WM_NOTIFY messages. This has led to the convention of referring to common control notifications, where the specific code identifies the notification.</B></P>
<P><B>Similarly, we will refer to custom draw notifications. Each <I>dwDrawStage</I> value specifies a particular custom draw notification. So when we say, for example, the item pre-paint notification, what is specifically meant is a WM_NOTIFY message with notification code NM_CUSTOMDRAW and an NMCUSTOMDRAW <I>dwDrawStage</I> member of CDDS_ITEMPREPAINT.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P>An application&#146;s response to the NM_CUSTOMDRAW notification under each of these conditions determines how the custom draw control proceeds with the paint cycle.</P>
<P>The <I>dwItemSpec</I> member of NMCUSTOMDRAW specifies the item number to which the notification corresponds. For example, this value would indicate the zero-based index of the particular list view control item being drawn.</P>
<P>For trackbar controls, three unique values are defined for the <I>dwItemSpec</I> member. These values specify what part of the trackbar control the parent window is being notified about:</P>
<DL>
<DD><B>TBCD_CHANNEL.</B> Identifies the trackbar channel.
<DD><B>TBCD_THUMB.</B> Identifies the trackbar thumb.
<DD><B>TBCD_TICS.</B> Identifies the trackbar tic marks.
</DL>
<P>A separate NM_CUSTOMDRAW notification is sent by a control for each item in that control. This gives the parent window the chance to customize every part of the control&#146;s appearance.
</P>
<P>For example, assume an NM_CUSTOMDRAW notification sent by a trackbar control with a <I>dwDrawStage</I> value of CDDS_ITEMPREPAINT and a <I>dwItemSpec</I> value of TBCD_TICS. This means that the trackbar control is notifying its parent that the trackbar is about to draw its tic marks.</P>
<P>The <I>uItemState</I> member of the NMCUSTOMDRAW structure specifies the current state of the item indicated by <I>dwItemSpec</I>. The following state identifiers can appear in this member. Not all values necessarily have meaning for all custom draw controls. For example, CDIS_CHECKED has no meaning for a trackbar, but does for a list view control that includes the LVS_EX_CHECKBOXES style:</P>
<DL>
<DD><B>CDIS_CHECKED.</B> The item is checked.
<DD><B>CDIS_DEFAULT.</B> The item is in its default state.
<DD><B>CDIS_DISABLED.</B> The item is disabled.
<DD><B>CDIS_FOCUS.</B> The item has focus.
<DD><B>CDIS_GRAYED.</B> The item is grayed.
<DD><B>CDIS_HOT.</B> The item is under the stylus/pointing device.
<DD><B>CDIS_SELECTED.</B> The item is selected.
</DL>
<P>The final NMCUSTOMDRAW member, <I>lItemlParam</I>, contains any application-defined data that may have been previously assigned to the control item by the application.</P>
<P>For example, list view control items are described by LV_ITEM structures. One of the LV_ITEM members is <I>lParam,</I> which can be used by applications to associate data with items. List view items participating in an NM_CUSTOMDRAW notification would send their <I>lParam</I> data in the NMCUSTOMDRAW <I>lItemlParam</I> member.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>TIP:&nbsp;&nbsp;</B><B>B<SMALL>OGUS</SMALL> NMCUSTOMDRAW <SMALL>RC</SMALL> M<SMALL>EMBER</SMALL></B>
<P><B>I have never seen a case where an NM_CUSTOMDRAW notification is sent by a control and the NMCUSTOMDRAW <I>rc</I> member had anything but garbage data in it. When implementing responses to custom draw notifications, it is more reliable to get the control&#146;s bounding rectangle yourself with a call to <I>GetClientRect</I>.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P>I should point out here that the Windows CE common controls that support the custom draw service do not need to be told by an application to enable their custom draw support. An application programmer might assume that some new control style must be added at creation time so that the control knows that its parent is interested in receiving custom draw notifications. But this is not the case. Controls send custom draw notifications by default. Applications decide to use the custom draw features by responding to these notifications. If the notifications are ignored by the parent window procedure, the service is effectively not used.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>E<SMALL>RASE</SMALL> N<SMALL>OTIFICATIONS</SMALL> C<SMALL>URRENTLY</SMALL> N<SMALL>OT</SMALL> S<SMALL>UPPORTED</SMALL></B>
<P><B>None of the global or item-specific pre- or post-erase notifications are currently supported in Windows CE.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Responding to Custom Draw Notifications</FONT></H3>
<P>An application&#146;s response to the various custom draw notifications controls the custom draw service behavior. Return values can specify how Windows CE completes a particular draw stage. They also can indicate whether or not further custom draw notifications are sent by the control.
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="275-278.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="282-285.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>


<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->

<!-- BEGIN SUB FOOTER -->
		<br><br>
		</TD>
    </TR>
	</TABLE>

		
	<table width="640" border=0 cellpadding=0 cellspacing=0>
		<tr>
		<td align="left" width=135><img src="/images/white.gif" width=100 height="1" alt="" border="0"></td>
		
		
<!-- END SUB FOOTER -->

<!-- all of the books have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->

<!-- FOOTER -->
			
		<td width="515" align="left" bgcolor="#FFFFFF">
<font face="arial, helvetica" size="1"><b><a href="/products.html"><font color="#006666">Products</font></a>&nbsp;|&nbsp; <a href="/contactus.html"><font color="#006666">Contact Us</font></a>&nbsp;|&nbsp; <a href="/aboutus.html"><font color="#006666">About Us</font></a>&nbsp;|&nbsp; <a href="http://www.earthweb.com/corporate/privacy.html" target="_blank"><font color="#006666">Privacy</font></a> &nbsp;|&nbsp; <a href="http://www.itmarketer.com/" target="_blank"><font color="#006666">Ad Info</font></a> &nbsp;|&nbsp; <a href="/"><font color="#006666">Home</font></a></b>
		<br><br>
		
		Use of this site is subject to certain <a href="/agreement.html">Terms &amp; Conditions</a>, <a href="/copyright.html">Copyright &copy; 1996-1999 EarthWeb Inc.</a><br> 
All rights reserved.  Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited.</font><p>
</td>
		</tr>
</table>
</BODY>
</HTML>

<!-- END FOOTER -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -