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

📄 349-352.html

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

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="345-349.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="353-356.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>Once registered, the shell sends WM_HOTKEY messages to the application whenever the particular program button is pressed. Parameters of these messages are explained in Table 13.13.
</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 13.13</B> The WM_HOTKEY Message.
<TR>
<TH WIDTH="40%" ALIGN="LEFT">PARAMETER
<TH WIDTH="60%" ALIGN="LEFT">MEANING
<TR>
<TD VALIGN="TOP">(int)wParam
<TD>Identifier of the hot key that generated the message. This is the value originally passed as the <I>id</I> parameter of the <I>RegisterHotKey</I> function.
<TR>
<TD VALIGN="TOP">(UINT)LOWORD(lParam)
<TD>Hot key modifier flags. This is the same as the <I>fsModifiers</I> parameter of the <I>RegisterHotKey</I> call that registered the hot key.
<TR>
<TD>(UINT)HIWORD(lParam)
<TD>Hot key virtual key code.
</TABLE>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">Adding Voice Input to Palm-size PC Applications</FONT></H3>
<P>The Palm-size PC SDK includes support for recording voice input. This allows application programmers to add voice recording features to their applications. Voice data recorded using a voice recorder control is stored in a .WAV file in the object store.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>V<SMALL>OICE</SMALL> <SMALL>ON</SMALL> O<SMALL>THER</SMALL> P<SMALL>LATFORMS</SMALL></B>
<P><B>Windows CE devices other than the Palm-size PC support voice input. Most notably, the Auto PC platform is largely voice driven. This chapter introduces the features of voice input in the context of the Palm-size PC.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P>These voice recording capabilities are provided by the Windows CE voice recorder control. The control contains a Play button, and optional Stop, Record, OK, and Close buttons. There is no voice recording API. Instead, the voice recorder control responds to a set of messages that control recording and playback.</P>
<P><FONT SIZE="+1"><B>Creating a Voice Recorder Control</B></FONT></P>
<P>An instance of the voice recorder control is created by calling the function <I>VoiceRecorder_Create</I>:</P>
<!-- CODE SNIP //-->
<PRE>
  VoiceRecorder_Create(lpCMVR);
</PRE>
<!-- END CODE SNIP //-->
<P>Like all other window creation functions, this function returns the HWND of the voice recorder control if control creation is successful. If <I>VoiceRecorder_Create</I> fails, it returns NULL.</P>
<P><I>lpCMVR</I> is a pointer to a CM_VOICE_RECORDER structure that specifies styles and other attributes of the control (see Figure 13.8). This structure is defined as:</P>
<P><A NAME="Fig8"></A><A HREF="javascript:displayWindow('images/13-08.jpg',240,320 )"><IMG SRC="images/13-08t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/13-08.jpg',240,320)"><FONT COLOR="#000077"><B>Figure 13.8</B></FONT></A>&nbsp;&nbsp;The voice recorder control.</P>
<!-- CODE //-->
<PRE>
  typedef struct tagCM_VOICE_RECORDER
  &#123;
    WORD cb;
    DWORD dwStyle;
    int xPos;
    int yPos;
    HWND hwndParent;
    int id;
    LPSTR lpszRecordFileName;
  &#125; CM_VOICE_RECORDER, *LPCM_VOICE_RECORDER;
</PRE>
<!-- END CODE //-->
<P>The <I>cb</I> member contains the size of the CM_VOICE_RECORDER structure. <I>hwndParent</I> specifies the voice recorder control&#146;s owner window. <I>id</I> is the voice control identifier.</P>
<P><I>xPos</I> and <I>yPos</I> are the x and y position of the control with respect to the control&#146;s owner window.</P>
<P>The <I>lpszRecordFileName</I> member is a null-terminated string that specifies the name of the default file to which the control stores the recording. It is also used as the default playback file name.</P>
<P>The <I>dwStyle</I> member is used to specify various styles&#146; bits for customizing the appearance and behavior of the voice recorder control. The available styles are detailed in Table 13.14.</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 13.14</B> Voice Recorder Control Styles
<TR>
<TH WIDTH="40%" ALIGN="LEFT">STYLE
<TH WIDTH="60%" ALIGN="LEFT">MEANING
<TR>
<TD>VRS_NO_OKCANCEL
<TD>The OK and Close buttons are not displayed.
<TR>
<TD>VRS_NO_NOTIFY
<TD>The control does not send notifications to the owner window.
<TR>
<TD VALIGN="TOP">VRS_MODAL
<TD>The control is implemented as a modal dialog instead of as a WS_POPUP-style dialog box. Thus, program control does not return to the calling application until the control is closed.
<TR>
<TD>VRS_NO_OK
<TD>The Stop button is not displayed.
<TR>
<TD>VRS_NO_RECORD
<TD>The Record button is not displayed.
<TR>
<TD VALIGN="TOP">VRS_PLAY_MODE
<TD>The control plays the file indicated by the <I>lpszRecordFileName</I> member immediately when the control is created.
<TR>
<TD VALIGN="TOP">VRS_NO_MOVE
<TD>The control&#146;s gripper handle is removed. The user therefore cannot move the control.
</TABLE>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE:&nbsp;&nbsp;</B><B>W<SMALL>HY</SMALL> D<SMALL>OES</SMALL> <SMALL>THE</SMALL> V<SMALL>OICE</SMALL> R<SMALL>ECORDER</SMALL> C<SMALL>ONTROL</SMALL> H<SMALL>AVE</SMALL> <SMALL>AN</SMALL> O<SMALL>WNER</SMALL> I<SMALL>NSTEAD OF A</SMALL> P<SMALL>ARENT</SMALL>?</B>
<P><B>Even though it&#146;s called a control, the voice recorder control is actually implemented as a WS_POPUP-style dialog box. Pop-up dialogs have owners, not parents. This is why the CM_VOICE_RECORDER structure specifies an owner.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P><FONT SIZE="+1"><B>Voice Recorder Control Messages</B></FONT></P>
<P>Applications use the various voice recorder control features by sending messages to the control. The control supports messages for recording and playing back files, stopping recording, and dismissing the control. The messages are listed in Table 13.15.
</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 13.15</B> Voice Recorder Control Messages
<TR>
<TH WIDTH="40%" ALIGN="LEFT">MESSAGE
<TH WIDTH="60%" ALIGN="LEFT">MEANING
<TR>
<TD VALIGN="TOP">VRM_CANCEL
<TD>Stops recording or playback. Also deletes any unsaved voice recorder files and closes the control.
<TR>
<TD VALIGN="TOP">VRM_OK
<TD>Same as VRM_CANCEL, except recorded data is saved to the current recording file.
<TR>
<TD VALIGN="TOP">VRM_PLAY
<TD>Plays the file specified by the string contained in the message <I>lParam</I>.
<TR>
<TD VALIGN="TOP">VRM_RECORD
<TD>Tells the control to begin recording. The message <I>lParam</I> contains the name of the file to which the recording is saved.
<TR>
<TD>VRM_STOP
<TD>Stops recording or playback.
</TABLE>
<P>The VRM_CANCEL, VRM_OK, and VRM_STOP messages take no parameters. The <I>wParam</I> and <I>lParam</I> parameters should be zero when sending or posting these messages with <I>SendMessage</I> or <I>PostMessage</I>.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="345-349.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="353-356.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 + -