The Active Desktop for a Windows CE-based device shares many features with Channel Browser and uses the underlying Mobile Channels infrastructures. The Active Desktop main window uses HTML controls to display system data and selected application shortcuts. 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.
The following code example for a sample Stock Market component shows that each desktop component is driven by a Mobile Channels script that you can supply.
<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 and define the desktop component 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. For information on supported HTML tags, see HTML Tag Reference. For more information on supported HTML tags, see "HTML Tag Reference."