Windows CE Active Desktop shares many features with Channel Browser and uses the underlying Mobile Channels infrastructures. Its main window uses HTML controls to display the system information and selected shortcuts to applications. Each control represents a desktop component. On a Windows CE-based device, such as the Palm-size PC, Active Desktop components typically include the Windows CE Logo, Owner Information, Appointments, Tasks, Messages, and custom desktop components. Tapping the Appointment component launches the Calendar application. Similarly, the Tasks and Messages items provide shortcuts to the Tasks and Inbox applications, respectively.
Each desktop component is driven by a Mobile Channels script. You can supply the script file for defining desktop components. The following MCS file for a sample Stock Market component gives you a working example.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<META HTTP-EQUIV=NOTIFY
content="CACHEUPDATE=http://Market/Stocks/Stocks.MCD;URL=mctp://Stocks">
<TITLE>Stock Quotes</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<%
SET MC = Server.CreateObject("MobileChannels.Utilities")
' Get the small logo image from the CDF
Base = MC.Navigate("", "INMATCH", "BASE")
LogoElem = MC.Navigate("", "INMATCH", "LOGO")
Logo = MC.Navigate(LogoElem, "INMATCH", "HREF")
LogoImg = MC.Value(Logo)
IF Base THEN LogoImg = MC.Value(Base) & LogoImg END IF
' Jump to the data reference in the CDF
DataElem = MC.Locate("D1")
' Create a table of SYMBOL/VALUE/CHANGE for each stock
Response.Write("<TABLE CELLPADDING=-1 CELLSPACING=-1>")
Response.Write("<TBODY>")
RecordNum = 1
Record = MC.Data(DataElem, RecordNum)
DO WHILE Record.Count
Response.Write("<TR VALIGN=BOTTOM>")
' Show the logo (from the CDF)
IF RecordNum = 1 THEN
Response.Write("<TD><IMG SRC=" & LogoImg & "></TD>")
Else
Response.Write("<TD></TD>")
END IF
Response.Write("<TD>" & Record(0).Value & "</TD>")
Response.Write("<TD ALIGN=RIGHT> $" & Record(1).Value & "</TD>")
Response.Write("<TD ALIGN=RIGHT> $" & Record(2).Value & "</TD>")
Response.Write("</TR>")
RecordNum = RecordNum + 1
Record = MC.Data(DataElem, RecordNum)
LOOP
Response.Write("</TBODY>")
Response.Write("</TABLE>")
' Show the user when the data was last updated (from data file)
Record = MC.Data(DataElem, 0)
IF Record.Count THEN
Response.Write("<HR><I>Last Updated</I>: " & Record(0).Value & " at " & Record(1).Value)
END IF
%>
</BODY>
</HTML>
You create a desktop component in a CDF file in which the desktop component is defined as a child element of a channel. To do this, you must use the following tag in the CDF file containing the desktop component:
<USAGE VALUE="MobileDesktopComponent"/>
Any such script is appropriately registered as a desktop component. The script files are then fed into the MCTP transport to process the data into the HTML format for display in the viewer. All the usual HTML tags are allowed.