Windows SideShow Samples

This section describes the sample gadgets for Windows SideShow, which are based on C++, that are included in the Windows SDK. These samples are not included with the Windows SideShow Managed API 1.0 SDK.

To see a sample gadget that is based on C# or Visual Basic, use the gadget wizard to generate a new project. For more information about using the gadget wizard, see Creating Windows SideShow Gadgets using Managed Code.

To build sample gadgets

  1. On 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. Go 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.

Cc982208.note(en-us,VS.85).gifNote:
To build the samples, you must have Windows Vista installed.

To run the samples

  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 later in this topic.

  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 creates 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."

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

Cc982208.note(en-us,VS.85).gifNote:
You may need to adjust the Icon entry to point to the appropriate location of HelloWorld.ico after you import the registry entries.

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

Cc982208.note(en-us,VS.85).gifNote:
When you press a key when prompted by the gadget, the gadget removes all content from the device.

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.

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

Cc982208.note(en-us,VS.85).gifNote:
You may need to adjust the Icon entry to point to the appropriate location of Alarms.ico after you import the registry entries.

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

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 how to:

  • Modify gadget-specific settings in Windows SideShow in Control Panel.

  • Start the gadget using the Gadget Manager utility in Windows SideShow.

  • 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 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.

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

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

Cc982208.note(en-us,VS.85).gifNote:
The process must be manually halted to turn off the gadget.

The device contains a list of tasks on 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:

  • Detect new content and update devices by using external events.

  • Manage gadget lifetime by using the Gadget Manager utility in Windows SideShow.

  • 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 resizes each image to fit the device screen.

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

Cc982208.note(en-us,VS.85).gifNote:
You may need to adjust the FriendlyName, Icon, and StartCommand entries to point to the appropriate locations after you import the registry entries.

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

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: