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

📄 310-312.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
			<option value="/reference/dir.archive1.html">Free Archive		
			</SELECT>
			</font></td>
	</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=11//-->
<!--PAGES=310-312//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="305-310.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch12/313-317.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Otherwise, the code simply toggles the GWL_BUTTONINVERT state depending on whether the stylus is dragged into or out of the pressed button. When the button is repainted, its appearance will alternate between the pressed and unpressed states.
</P>
<P><FONT SIZE="+1"><B><I>CBTN_TOGGLE Style Custom Button Controls</I></B></FONT></P>
<P>There are only minor differences in the stylus handling for CBTN_TOGGLE-style buttons. The basic difference is determining when to change the GWL_BUTTONINVERT state so that the button remains pressed until tapped again.
</P>
<P>The WM_LBUTTONDOWN code for CBTN_TOGGLE-style controls looks like this:</P>
<!-- CODE SNIP //-->
<PRE>
  BOOL bInvert;
  SetCapture(hwnd);
  bInvert = (BOOL)GetWindowLong(hwnd, GWL_BUTTONINVERT);
  SetWindowLong(hwnd,
    GWL_BUTTONINVERT, (LONG)(!bInvert));
</PRE>
<!-- END CODE SNIP //-->
<P>Whereas the CBTN_PUSH style controls always set the GWL_BUTTONINVERT state to TRUE on a stylus tap, the CBTN_TOGGLE buttons toggle this state.
</P>
<P>If you refer to the WM_LBUTTONUP code in Figure 11.3, you will see only one difference between CBTN_TOGGLE and CBTN_PUSH controls. The difference is these lines, which force toggle-style buttons to set the invert state extra window word to FALSE:</P>
<!-- CODE SNIP //-->
<PRE>
  if (!IsToggleStyle(hwnd))
  &#123;
    SetWindowLong(hwnd, GWL_BUTTONINVERT, (LONG)FALSE);
  &#125;
</PRE>
<!-- END CODE SNIP //-->
<P>In other words, when the user releases a CBTN_TOGGLE-style button, the toggle state does not change. In this way, a pressed button stays pressed and an unpressed button stays unpressed. The toggle state does not change until the button is pressed again, as shown by the WM_LBUTTONDOWN code above.
</P>
<P>Similarly, CBTN_TOGGLE-style buttons do not change state when the stylus moves across them. These lines in the WM_MOUSEMOVE code ensure this:</P>
<!-- CODE SNIP //-->
<PRE>
  if (!IsToggleStyle(hwnd))
  &#123;
    SetWindowLong(hwnd, GWL_BUTTONINVERT, (LONG)bInvert);
  &#125;
</PRE>
<!-- END CODE SNIP //-->
<H3><A NAME="Heading6"></A><FONT COLOR="#000077">The Complete Sample Application</FONT></H3>
<P>The complete source code for the custom button control DLL and the client application are included on the companion CD. The directory \Samples\custom contains the client application source code. The directory \Samples\control contains the source code for the custom control DLL, as well as the Microsoft Developer Studio workspace file for both of these components.
</P>
<H3><A NAME="Heading7"></A><FONT COLOR="#000077">Concluding Remarks</FONT></H3>
<P>In Chapters 9, 10, and 11, we have discussed some of the features provided by Windows CE for designing custom application user interfaces. Owner draw controls let you take over the control painting process in your application code. The custom draw service is similar, but provides more flexibility by giving your application the opportunity to intercede at specific times in the control&#146;s paint cycle.
</P>
<P>There may be occasions when even more customization is required. For these jobs you can implement complete new controls from scratch using the custom control programming techniques you have just read about.</P>
<P>As you gain experience using these programming techniques, you will come to appreciate the flexibility that Windows CE offers for designing custom user interfaces for your applications.</P>
<P>The next two chapters discuss some additional Windows CE user interface features. Chapter 12 introduces the HTML Viewer control. Chapter 13 describes how to program some of the user interface features specific to the Palm-size PC platform.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="305-310.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch12/313-317.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 + -