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

📄 247-250.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
			<option value="/reference/whatsnew.html">New Titles
			<option value="">-----------
			<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=9//-->
<!--PAGES=247-250//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="243-247.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="250-253.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading2"></A><FONT COLOR="#000077">Chapter 9<BR>Owner Draw Controls and Custom Window Classes
</FONT></H2>
<P><BIG><BIG>T</BIG></BIG>he easiest way to change the appearance of a Windows CE control is to make the control <I>owner draw</I>. An owner draw control is a control whose parent window, not the control itself, takes responsibility for creating the physical appearance of the control.</P>
<P>A number of Windows CE controls support the owner draw feature. The techniques for programming owner draw controls is the same for any supported control. This chapter therefore presents these techniques in the context of owner draw buttons.</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Why Focus on Owner Draw Buttons?</FONT></H3>
<P>Of all of the controls that can be used in Windows CE applications, push buttons are probably the most common. Buttons appear everywhere. They fill dialog boxes, letting users choose between various application feature options. Buttons are universal in providing the OK-Cancel choices for committing user input. Buttons send our e-mail and help us navigate around Web pages in Web browser software.
</P>
<P>Given how common this control is in applications, it is no wonder that most Windows CE software vendors are interested in changing the basic appearance of the button control to differentiate their user interfaces from those of their competitors.</P>

<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">
<TR><TD><FONT SIZE="+1"><B>Other Windows CE Owner Draw Controls</B></FONT>
<P>The concepts presented in this chapter can be applied to more than just owner draw buttons. Several other controls in Windows CE, such as the list view control and the tab control, to mention a few, support the owner draw functionality.
</P>
<P>For example, a tab control created with the TCS_OWNERDRAWFIXED style sends WM_DRAWITEM messages to its parent just like owner draw buttons do. The DRAWITEMSTRUCT structure passed with each message contains information about the individual tab control items. The owner window can use this information to draw the tab items any way it pleases.</P>
<P>The Windows CE controls that support owner draw functionality are the header control, list view control, status bar control, tab bar control, and, of course, the button control.</P>
</TABLE>

<P>Fortunately, modifying the appearance of button controls is relatively simple. Windows CE, like its Win32 desktop relatives, provides this feature with a programming technique called <I>owner draw buttons</I>. With an owner draw button, as with regular push buttons, all of the messaging behavior such as detecting stylus taps and generating WM_COMMAND messages is taken care of for you by Windows CE. But all aspects of the appearance of an owner draw button must be implemented by the owner of the button. Hence the name owner draw button.</P>
<P>The basic concept of owner draw buttons is one that will already be familiar to the more experienced Windows programmers who read this book. But it is presented here nonetheless for a variety of reasons.</P>
<P>First, organizations that are developing Windows CE&#150;based products are almost universally consumed with a passion for making their user interfaces look like anything but a desktop PC. Therefore, it is useful to review even the most basic techniques for customizing an application&#146;s look and feel.</P>
<P>Second, the details of owner draw buttons may be unfamiliar to application programmers who come to Windows CE with lots of experience programming with the Microsoft Foundation Classes. This chapter, like Chapters 2 and 3, is partly motivated by a desire to familiarize such programmers with key Windows CE features at the API level.</P>
<P>And third, not everyone is familiar with every traditional Windows programming technique. Many Windows CE software developers come from embedded systems backgrounds. They often need to understand Windows CE programming from both a systems and an applications level. Such readers can benefit from a description of the basics.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>AFTER COMPLETING THIS CHAPTER YOU WILL KNOW HOW TO&#133;</B>
<DL>
<DD><B>Use owner draw buttons in your applications</B>
<DD><B>Use Windows CE timers</B>
<DD><B>Draw graphics using offscreen bitmaps</B>
<DD><B>Design custom window classes</B>
</DL>
<HR></FONT>
</BLOCKQUOTE>
<H3><A NAME="Heading4"></A><FONT COLOR="#000077">The Example Application</FONT></H3>
<P>The example application demonstrating the concepts presented in this chapter is found in \Samples\kiosk on the companion CD. The executable is called KIOSK.EXE.
</P>
<P>This application attempts to demonstrate what the front end of a kiosk-style Windows CE device might look like. A common example of a kiosk familiar to most people is the bank automatic teller machine. A kiosk can be described as a dedicated single-purpose device that performs one service for a user. Other examples include the computerized video catalogs that are common in many movie rental chains or those do-it-yourself photo enlargers that are making their way into photo finishing shops.</P>
<P>KIOSK.EXE is an example bank ATM user interface. The user&#146;s choices are represented on the screen as owner draw buttons. The main application window and the secondary window that contains the owner draw buttons are made to look different from standard Windows CE windows. This is done by customizing certain aspects of the window classes that govern these windows.</P>
<P>In addition to providing insight into owner draw buttons and custom window classes, this example will also provide a review of some important graphics functions of the Windows CE Graphics, Windowing, and Event Subsystem.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>T<SMALL>HIS</SMALL> C<SMALL>HAPTER</SMALL> C<SMALL>ONTAINS</SMALL> T<SMALL>WO</SMALL> S<SMALL>AMPLE</SMALL> A<SMALL>PPLICATIONS</SMALL></B>
<P><B>This chapter actually contains two sample applications. KIOSK.EXE is the main one, demonstrating the entire kiosk user interface. \Samples\button contains the source code for the short owner draw button example, BUTTON.EXE, shown in Figures 9.1 and 9.2.</B><HR></FONT>
</BLOCKQUOTE>
</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="243-247.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="250-253.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 + -