📄 031-033.html
字号:
<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=""> <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=2//-->
<!--PAGES=031-033//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="028-031.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="034-036.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>For future reference, Table 2.3 lists all of the window style values that can be specified in calls to CreateWindow. Similarly, the extended style values that can be used in CreateWindowEx calls are shown in Table 2.4.
</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 2.3</B> Windows CE Window Styles
<TR>
<TH WIDTH="30%" ALIGN="LEFT">STYLE
<TH WIDTH="70%" ALIGN="LEFT">MEANING
<TR>
<TD>WS_BORDER
<TD>Window has a thin border.
<TR>
<TD VALIGN="TOP">WS_CAPTION
<TD>Window has a title bar. This style also includes the WS_BORDER style.
<TR>
<TD>WS_CHILD
<TD>Window is a child window. Cannot be used with WS_POPUP style.
<TR>
<TD VALIGN="TOP">WS_CLIPCHILDREN
<TD>Excludes the area occupied by child windows when drawing occurs within window.
<TR>
<TD>WS_CLIPSIBLINGS
<TD>Clips child windows relative to each other.
<TR>
<TD>WS_DISABLED
<TD>Window is initially disabled when created.
<TR>
<TD VALIGN="TOP">WS_DLGFRAME
<TD>Window has a dialog box style border. Windows with this style cannot have title bars (i.e., cannot have WS_CAPTION style).
<TR>
<TD>WS_GROUP
<TD>Identifies the window as the first in a group of controls.
<TR>
<TD>WS_HSCROLL
<TD>Window has a horizontal scroll bar.
<TR>
<TD>WS_OVERLAPPED
<TD>Window has a title bar and a border.
<TR>
<TD>WS_POPUP
<TD>Creates a pop-up window.
<TR>
<TD VALIGN="TOP">WS_SYSMENU
<TD>Window has a system menu in its title bar. Such windows must also have the WS_CAPTION style.
<TR>
<TD VALIGN="TOP">WS_TABSTOP
<TD>Specifies a control that can receive the keyboard focus when the user presses the Tab key. Pressing the Tab key changes the keyboard focus to the next control with the WS_TABSTOP style.
<TR>
<TD>WS_VISIBLE
<TD>Window is initially visible when created.
<TR>
<TD>WS_VSCROLL
<TD>Window has a vertical scroll bar.
</TABLE>
<P>
</P>
<TABLE WIDTH="100%" BORDER RULES="ROWS"><CAPTION ALIGN=LEFT><B>Table 2.4</B> Windows CE Extended Window Styles
<TR>
<TH WIDTH="30%" ALIGN="LEFT">EXTENDED STYLE
<TH WIDTH="70%" ALIGN="LEFT">MEANING
<TR>
<TD VALIGN="TOP">WS_EX_NOACTIVATE
<TD>A top-level window created with this style cannot be activated. If a child window has this style, tapping it will not cause its top-level parent to be activated. A window that has this style will receive stylus events, but neither it nor its child windows can get the focus.
<TR>
<TD VALIGN="TOP">WS_EX_NOANIMATION
<TD>A window created with this style does not show animated exploding and imploding rectangles when created, closed, or deleted, and does not have a button on the taskbar.
<TR>
<TD>WS_EX_CLIENTEDGE
<TD>Specifies that a window has a border with a sunken edge.
<TR>
<TD VALIGN="TOP">WS_EX_CONTEXTHELP
<TD>Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window.
<TR>
<TD VALIGN="TOP">WS_EX_CONTROLPARENT
<TD>Allows the user to navigate among the child windows of the window by using the Tab key.
<TR>
<TD VALIGN="TOP">WS_EX_DLGMODALFRAME
<TD>Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter.
<TR>
<TD>WS_EX_NODRAG
<TD>Creates a window that cannot be dragged
<TR>
<TD VALIGN="TOP">WS_EX_STATICEDGE
<TD>Creates a window with a three-dimensional border style, intended to be used for items that do not accept user input.
<TR>
<TD VALIGN="TOP">WS_EX_TOPMOST
<TD>Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.
<TR>
<TD>WS_EX_WINDOWEDGE
<TD>Specifies that a window has a border with a raised edge.
</TABLE>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B><B>MDI W<SMALL>INDOWS</SMALL> A<SMALL>RE</SMALL> G<SMALL>ONE</SMALL></B>
<P><B>Windows CE currently does not support Multiple Document Interface (MDI) windows.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B><B>M<SMALL>AXIMIZED</SMALL>/M<SMALL>INIMIZED</SMALL> W<SMALL>INDOWS</SMALL></B>
<P><B>Windows CE does not support the Windows NT/Windows 98 concepts of maximizing or minimizing windows. This is why you see none of the window styles for including a maximize or minimize box in the style tables in this chapter.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<H3><A NAME="Heading4"></A><FONT COLOR="#000077">The Windows CE Application Entry Point</FONT></H3>
<P>As you might remember, back in the days of C programming in non-Windows environments, programs started with a line that looked something like this:
</P>
<!-- CODE SNIP //-->
<PRE>
void main(int argc, char** argv)
</PRE>
<!-- END CODE SNIP //-->
<P>This function, <I>main</I>, was called the <I>program entry point</I>. To make a long story short, this was the function that the operating system called to start the program execution.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B><B>T<SMALL>HE</SMALL> WINAPI S<SMALL>PECIFIER</SMALL></B>
<P><B>The WINAPI specifier is an alias for the _stdcall calling convention.</B><HR></FONT>
</BLOCKQUOTE>
</P>
<P>The various Win32-based operating systems also need an entry point. For the Win32 operating systems, including Windows CE, the entry point is called <I>WinMain</I>. The prototype of <I>WinMain</I> is:</P>
<!-- CODE SNIP //-->
<PRE>
int WINAPI WinMain(hInstance, hPrevInstance,
lpCmdLine,nCmdShow);
</PRE>
<!-- END CODE SNIP //-->
<P>Under Windows CE, multiple copies, or instances, of an application may be launched at a time. The <I>hInstance</I> and <I>hPrevInstance</I> parameters are both HINSTANCE values. <I>hInstance</I> is the handle of the current application instance. <I>hPrevInstance</I> is always NULL.<SUP><SMALL><B>1</B></SMALL></SUP></P>
<BLOCKQUOTE>
<HR>
<SUP><SMALL><B>1</B></SMALL></SUP><FONT SIZE="-1">In older versions of Windows, if multiple instances of an application were running, <I>hPrevInstance</I> specified the instance of an application that was launched prior to the current one. Under Windows CE you can determine if another instance is running by calling the <I>CreateMutex</I> API function and then calling <I>GetLastError</I>. If <I>GetLastError</I> returns the error code ERROR_ALREADY_EXISTS, there is another instance of the application running.
</FONT>
<HR>
</BLOCKQUOTE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="028-031.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="034-036.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> | <a href="/contactus.html"><font color="#006666">Contact Us</font></a> | <a href="/aboutus.html"><font color="#006666">About Us</font></a> | <a href="http://www.earthweb.com/corporate/privacy.html" target="_blank"><font color="#006666">Privacy</font></a> | <a href="http://www.itmarketer.com/" target="_blank"><font color="#006666">Ad Info</font></a> | <a href="/"><font color="#006666">Home</font></a></b>
<br><br>
Use of this site is subject to certain <a href="/agreement.html">Terms & Conditions</a>, <a href="/copyright.html">Copyright © 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 + -