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

📄 087-090.html

📁 WindowsCE.[Essential Windows CE Application Programming].Jon Wiley & Son.zip
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- 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=4//-->
<!--PAGES=087-090//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="083-087.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="090-093.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>The basic rule of thumb for adding tool tips is that you must specify as many strings as components in your command bar (menus, combo boxes, and command bar buttons). Additionally, these strings must be specified in <I>lpToolTips</I> in the same order as the command bar components.</P>
<P>The <I>CommandBar_AddToolTips</I> function returns TRUE if successful. Otherwise, it returns FALSE.</P>
<H3><A NAME="Heading9"></A><FONT COLOR="#000077">Other Command Bar Functions</FONT></H3>
<P>There are some other command bar functions we have not yet covered. These remaining functions provide functionality for such things as showing or hiding command bars, determining if a command bar is visible, and so on.
</P>
<P>The remaining functions are pretty self-explanatory. They are listed in Table 4.5.</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 4.5</B> Miscellaneous Command Bar Control Functions
<TR>
<TH WIDTH="40%" ALIGN="LEFT">FUNCTION
<TH WIDTH="60%" ALIGN="LEFT">MEANING
<TR>
<TD VALIGN="TOP">CommandBar_Destroy
<TD>Destroys the specified command bar without destroying the parent window.
<TR>
<TD VALIGN="TOP">CommandBar_DrawMenuBar
<TD>Used to redraw or reposition the menu in the specified command bar.
<TR>
<TD VALIGN="TOP">CommandBar_GetMenu
<TD>Retrieves the menu handle (HMENU) of the specified command bar menu.
<TR>
<TD>CommandBar_Height
<TD>Gets the height of the specified command bar.
<TR>
<TD>CommandBar_IsVisible
<TD>Determines if the specified command bar is visible or not.
<TR>
<TD>CommandBar_Show
<TD>Shows or hides the specified command bar.
</TABLE>
<H3><A NAME="Heading10"></A><FONT COLOR="#000077">Using Accelerators in Windows CE Applications</FONT></H3>
<P>Desktop computers have relied heavily on keyboard accelerators for years. A <I>keyboard accelerator</I> is a keystroke combination that duplicates the behavior of a menu item or control.</P>
<P>Keyboard accelerators are a useful feature of many popular Windows applications. After becoming familiar with the keyboard equivalents of common menu selections, users can greatly increase the speed at which they use applications.</P>
<P>Windows CE provides the same keyboard accelerator support as desktop versions of Windows. Since Windows CE devices are not required to have a keyboard, accelerators don&#146;t make sense for all devices. But many devices do have keyboards, so briefly covering the subject of keyboard accelerators is worthwhile. And you never know when the Palm-size PC application that you write today will need to be ported to run on Handheld PCs.</P>
<P>Accelerator tables are pretty small, so the memory they consume is minimal. And compiling out the application code that enables them with preprocessor symbols is easy. As we will see, once the accelerators are defined, enabling them can be done with exactly five lines of code.</P>
<P><FONT SIZE="+1"><B>Accelerator Resources</B></FONT></P>
<P>Like menus, keyboard accelerators are a type of Windows CE resource. They are defined in a resource file as an <I>accelerator table</I>. An accelerator table has the following general syntax:</P>
<!-- CODE SNIP //-->
<PRE>
  TableName ACCELERATORS [DISCARDABLE]
    BEGIN
     [Acclerator definitions]
    END
</PRE>
<!-- END CODE SNIP //-->
<P><I>TableName</I> is either the resource identifier or a string name identifying the resource. The accelerator table for this CMDBAR.EXE is defined as follows:</P>
<!-- CODE SNIP //-->
<PRE>
  IDR_ACCELERATOR ACCELERATORS DISCARDABLE
  BEGIN
    "E",      IDC_EMPTY,   VIRTKEY, CONTROL, NOINVERT
    "F",      IDC_FILL,   VIRTKEY, CONTROL, NOINVERT
    "Q",      IDC_EXIT,   VIRTKEY, CONTROL, NOINVERT
  END
</PRE>
<!-- END CODE SNIP //-->
<P>Each of the accelerator definitions identifies the keyboard key that must be pressed to invoke the accelerator.
</P>
<P>The second item in each definition is the control or menu item identifier to which the accelerator corresponds. This is the command identifier that Windows CE sends with the WM_COMMAND message to the window that owns the accelerators.</P>
<P>The VIRTUAL keyword indicates that Windows CE is to use the virtual key code, not the ASCII key code, for the key specified in the accelerator definition.</P>
<P>CONTROL indicates that the Control key must also be pressed to invoke the accelerator. So the first definition means that the key combination Ctrl&#43;E must be pressed. Other keywords of this type are SHIFT and ALT, indicating that the Shift or Alt key must be pressed. For example, to define an accelerator for the key combination Alt&#43;Shift&#43;X, the accelerator table would include this line:</P>
<!-- CODE SNIP //-->
<PRE>
  "X",  SomeID, VIRTKEY, SHIFT, ALT, NOINVERT
</PRE>
<!-- END CODE SNIP //-->
<P>The NOINVERT keyword says that the menu containing the menu item corresponding to the accelerator&#146;s control identifier is not inverted (i.e., not highlighted) when the accelerator key combination is pressed. Leaving out this keyword forces Windows CE to try to invert the menu.
</P>
<P>The identifiers such as IDR_ACCELERATOR and IDC_EMPTY are typically defined in the application&#146;s RESOURCE.H file.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="083-087.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="090-093.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 + -