• subscribe
March 01, 1997 12:00 AM

Customizing Graphics for SMS Custom Inventory Objects

Windows IT Pro
InstantDoc ID #73
Polishing Systems Management Server

My last article ("Customizing Systems Management Server," January 1997) explained how you add custom inventory groups and architectures (inventory items) to the Systems Management Server (SMS) inventory with Management Information Format (MIF) files. This article shows how to polish your SMS inventory by creating custom graphics to represent the custom inventory objects, such as a printer. Once you learn how to name resources so that SMS can access them, you can build and register a custom DLL that contains the custom graphics SMS will use. Creating these custom graphics requires some coding, but as you'll see, you don't need to be a programmer to accomplish this simple task, especially if you have a modern development tool such as Microsoft Visual C++ (VC++).

Customizing Bitmaps and Icons in SMS Administrator
SMS uses standard bitmaps and icons to identify custom inventory objects. So, after you create a custom architecture object, it appears as a default bitmap in the SMS Administrator Sites window. For example, the custom Printer architecture I created for the January article appears as the default bitmap for HP Printer 1, as you see in Screen 1.

Whereas custom architectures appear as bitmaps, custom groups appear as icons. By opening the Properties window for HP Printer 1, you see the icons shown in Screen 2. In this screen, the custom printer groups appear as default SMS icons. Unfortunately, these generic graphics don't illustrate the nature of the objects.

Ideally, you want the graphics to reflect the type of inventory objects they represent. Fortunately, you can display custom bitmaps and icons for new custom groups or architectures. You override default SMS architecture and group icons by providing SMS with a DLL that contains custom bitmap and icon resources. SMS can then use these resources to represent your custom inventory objects. To tell SMS to use the DLL, you have to add special entries to the Windows NT Registry. Let's look at SMS's requirements for naming graphic resources so you can make them available for SMS use.

Bitmap and Icon Resource Naming for SMS
To display a graphic for an inventory object, SMS first searches custom resource-only DLLs registered with the NT Registry and then searches its standard resources for a bitmap with a resource name of architecture_systemtype_systemrole. If SMS can't find this bitmap, it looks for a resource named architecture_systemrole.

Here, architecture is the name of the inventory object's (i.e., the component's) Architecture group (which defines the component and its attribute structure) in a MIF, systemtype is the value of the SystemType attribute of the component's Identification group (which lists attributes that identify the instance of the component the MIF describes), and systemrole is the value of the SystemRole attribute of the component's Identification group (see my January article for details). So, for example, in Screen 1, HP Printer 1 has an Architecture of Printer, a SystemType of Laser Printer, and a SystemRole of Printer. You can create a specific bitmap resource (PRINTER_LASER_PRINTER_PRINTER) that appears for laser printers such as HP Printer 1 and a general printer bitmap resource (PRINTER_PRINTER) that appears for non-laser printers. Note that SMS treats resource names as uppercase and replaces spaces with underscores.

When you display the properties for a component, each group within the component appears as an icon in the Properties pane on the left side of the Properties window. The exception is the Architecture group in the window title. Screen 2 shows the resulting properties window for the Printer architecture. Notice that the title bar contains "Printer Properties," which identifies the component's architecture.

SMS selects the icon that appears for each group in the Architecture Properties window similarly to how it selects the bitmaps for the SMS Administrator Sites window. For a given group, SMS searches for registered custom resource-only DLLs first and then searches through its standard resources for an icon with the following resource names, respectively:

PDG_systemtype_groupname PDG_architecture_groupname PDG_STD_groupname

Systemtype and architecture have the same meaning for icons as they do for bitmaps, and groupname is the value of the Name property for the group (PDG and STD are fixed prefixes). For the /Screen_0 example in Screen 2, you can create very specific icon resources (PDG_LASER_/Screen_0_/Screen_0_DETAILS and PDG_LASER_/Screen_0_PRINTER_FONTS) because the two groups are Printer Details and Printer Fonts and HP Printer 1 is a Laser Printer. Optionally, you can create more general resources (PDG_PRINTER_PRINTER_DETAILS and PDG_PRINTER_PRINTER_FONTS) or minimally specific resources (PDG_ STD_PRINTER_DETAILS and PDG_STD_PRINTER_FONTS). Let's build and register a custom resource-only DLL that uses a combination of these last two resource options.



ARTICLE TOOLS

Comments
  • Vishnu
    9 years ago
    Dec 25, 2003

    this site is very helpful for freshers in VC++.net .A main problem is no other programmes in VC++.net.

You must log on before posting a comment.

Are you a new visitor? Register Here