Windows SideShow Samples 

Windows SideShow Samples

This section describes the sample gadgets for Windows SideShow that are included in the Windows SDK.

Build Steps

Follow these steps to build the sample gadgets.

Note:
To build the samples, you must have Windows Vista installed.

  1. From the Start menu, point to All Programs, click Microsoft Windows SDK, right-click CMD Shell, and then click Run as administrator. This opens a command window with elevated permissions in the SDK root directory.
  2. Move to the sample folder for Windows Sideshow:
    cd Samples\WinUI\SideShow
    
  3. There are four subfolders: Alarms, HelloWorld, Pictures, and Tasks. Type nmake in each sample folder to build the sample.

Running the Samples

Follow these steps to run a sample gadget. Specific instructions for running samples are described in each sample section below.

  1. Start the simulator or connect a device. For instructions on running the simulator, see Simulator for Windows SideShow.
  2. Register the gadget with Windows SideShow. Specific instructions for registering each sample are described within each sample section below.
  3. Enable the gadget for a device in Windows SideShow in Control Panel. For instructions, see Windows SideShow Control Panel.
  4. Run the gadget.

Hello World Sample

The Hello World sample demonstrates the creation of a simple Windows SideShow gadget. The gadget registers with the Simple Content Format endpoint and sends a content page to the device that includes the string "Hello World".

Registering: To register this sample, load the contents of HelloWorld.reg into the registry.

Note:
You may need to adjust the Icon entry to point to the appropriate location of HelloWorld.ico after you import the registry entries.

Running: To run this sample, locate the compiled binary and run WindowsSideShowHelloWorld.exe.

Note:
When you press a key when prompted by the gadget, the gadget removes all content from the device.

Output: When the gadget runs successfully, it sends a single page of content that says "Hello Windows SideShow World".

This sample demonstrates the use of the following interfaces:

Alarm Clock Sample

The Alarm Clock sample demonstrates a Windows SideShow gadget that sends notifications to a device. The gadget registers with Windows SideShow and sends notifications based on user-specified alarm times.

Registering: To register this sample, load the contents of Alarms.reg into the registry.

Note:
You may need to adjust the Icon entry to point to the appropriate location of Alarms.ico after you import the registry entries.

Running: To run this sample, locate the compiled binary and run WindowsSideShowAlarms.exe.

Output: The gadget opens a window on the computer named My Alarm, and you can set an alarm time there. When the alarm time elapses, the gadget displays a notification on the device.

This sample demonstrates the use of the following interfaces:

Task List Sample

The Task List sample demonstrates several features of Windows SideShow.

  1. Modify gadget-specific settings in Windows SideShow in Control Panel.
  2. Start the gadget via the Gadget Manager utility in Windows SideShow.
  3. Handle Simple Content Format events from the device.

This gadget retrieves its data from the TaskList.xml file in the sample folder. Rather than pre-cache content on the device, it waits for the ISideShowEvents::ContentMissing Method to send content to the device on demand. The gadget stores its settings in a Tasks.ini file in the executing directory. To modify these settings go to Windows SideShow in Control Panel and click the gadget name.

Registering: To register this sample, locate the compiled WindowsSideShowTasks.dll, and from an administrative command prompt, run regsvr32 WindowsSideShowTasks.dll.

Running: This sample runs automatically when it is enabled in Control Panel.

Note:
The process must be manually halted to turn off the gadget.

Output: The device contains a list of tasks in a menu page. When a user selects an item on the page, content for the specific task is retrieved from the sample gadget on demand.

This sample demonstrates the use of the following interfaces:

Pictures Sample

The Pictures sample demonstrates how to:

  1. Detect new content and update devices by using external events.
  2. Manage gadget lifetime by using the Gadget Manager utility in Windows SideShow.
  3. Differentiate content on a per-device basis.

The gadget takes JPEG images from %USERPROFILE%\Pictures and sends them to the device where they can be viewed. The gadget monitors the Pictures directory, automatically picks up new images that have been added, and sends them to the device. When the gadget sends images to the device, the gadget makes use of the ability to tailor the content by resizing each image to fit the device screen.

Registering: To register this sample, load the contents of Pictures.reg into the registry.

Note:
You may need to adjust the FriendlyName, Icon, and StartCommand entries to point to the appropriate locations after you import the registry entries.

Running: This sample runs automatically when it is enabled in Control Panel.

Output: The Windows SideShow Pictures gadget on the device receives a set of pictures. The first picture appears when you turn on the gadget on the device. To view the various images, navigate with the RIGHT ARROW and LEFT ARROW buttons on the device or simulator.

This sample demonstrates the use of the following interfaces:

See Also

Concepts

Windows SideShow API Reference

Other Resources

About Windows SideShow

Show: