Using a Custom Bitmap for a PowerBuilder Window Icon

Sybase’s PowerBuilder allows you to choose an icon for a window. However, the list includes only the .ico resources. Menus and toolbars, which can use the bitmap resources, have a much larger set of images in their drop-downs.

I don’t really care about the nuances that distinguish icon and bitmap resources. I just want the image choices to be consistent throughout the product.

The Problem

Here’s what can happen:

You find a custom image you really like for your dialog, and you assign it to the menu item, the toolbar item and perhaps a picture button or two. So you have your image appearing consistently throughout your application so the user is really dialed-in to what you want that image to convey. Then, you think, hey, let’s also put the image as the icon for my dialog (by icon, I mean the small image that appears in the window header, usually on the far left).

But, you discover that the choices for your windows are limited only to .ico resources. A very small listing in PowerBuilder.

The Solution

Here’s how you get the bitmap out of PowerBuilder so you can use it as an icon:

Using Resource Hacker, open the pbvm DLL. For PB 9.0, this is Program Files / Sybase / Shared / PowerBuilder / pbvm90.dll.

Select View / Expand Tree.

Now, scroll through the list looking for the image you’re after. Once you find it, right-click and choose Save [Bitmap : 25 :1033 ] (your numbers will be different).

Now, you simply convert that bitmap to an icon. Using IrfanView, open the image, and save it as an .ICO file with transparency. Select the color you want to be transparent (usually the gray color), and you’re all set!

Published in: on March 20, 2008 at 6:05 pm Leave a Comment
Tags:

The URI to TrackBack this entry is: http://dmcmeans.wordpress.com/2008/03/20/using-a-custom-bitmap-for-a-powerbuilder-window-icon/trackback/

RSS feed for comments on this post.

Leave a Comment