Language

DeviceCapabilities.GetScreenHeight Method

Gets the device's screen height.

Namespace: Microsoft.SideShow
Assembly: Microsoft.SideShow (in microsoft.sideshow.dll)

Usage

Syntax

'Declaration
Public Function GetScreenHeight As Short
public short GetScreenHeight ()
public:
short GetScreenHeight ()
public short GetScreenHeight ()
public function GetScreenHeight () : short

Example

The following code illustrates how to display the number of connected devices, each device's ID, and some of the capabilities of the devices.

private static void SampleDeviceCapabilities()
{
    // Set the gadget's GUID.
    Guid gadgetId = new Guid("{0530B726-F6D5-4a66-900E-3C7673316F3B}");
    
    // Register the gadget.
    GadgetRegistration.Register(
        false,                           // Register gadget for current user only
        gadgetId,                        // Guid for the registry subkey
        ScfSideShowGadget.ScfEndpointId, // Endpoints registry value
        "Example SideShow gadget",       // FriendlyName registry value
        null,                            // StartCommand registry value
        null,                            // Icon registry value, this gadget will use the generic gadget icon.
        false,                           // OnlineOnly registry value
        GadgetCachePolicies.KeepNewest,  // CachePolicy registry value
        null);

    // Connected SideShow device capabilities.
    using (ScfSideShowGadget gadget = new ScfSideShowGadget(gadgetId))
    {
        // Display the number of connected SideShow devices.
        Console.WriteLine("Device count=" + gadget.GetDeviceCount());
        // Get the capabilities for each connected SideShow device.
        DeviceCapabilities[] caps = gadget.GetCapabilitiesForDevices();
        // Display the DeviceId, ScreenHeight, ScreenWidth, ColorDepth and SupportedImageFormats for each connected SideShow device.
        for (Int32 n = 0; n < caps.Length; n++)
        {
            Console.WriteLine("Device #{0} has ID of {1}", n, caps[n].GetDeviceId());
            Console.WriteLine("Device #{0} has a screen height of {1}", n, caps[n].GetScreenHeight());
            Console.WriteLine("Device #{0} has a screen width of {1}", n, caps[n].GetScreenWidth());
            Console.WriteLine("Device #{0} has a color depth of {1}", n, caps[n].GetColorDepth());
            Console.WriteLine("Device #{0} supports the following image formats: {1}", n, caps[n].GetSupportedImageFormats());
        }
    }
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

Target Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

See Also

Reference

DeviceCapabilities Class
DeviceCapabilities Members
Microsoft.SideShow Namespace