Using Custom Icons

The QuickWin run-time library provides default icons that appear when the user minimizes the application's frame window or its child windows. You can add custom-made icons to your executable files, and Windows will display them instead of the default icons.

To add a custom child window icon to your QuickWin program:

  1. Select Resource from the Insert menu in the visual development environment. Select Icon from the list that appears. The screen will become an icon drawing tool.

  2. Draw the icon. (For more information about using the Graphics Editor in the visual development environment, see "Resource Editors, Graphics Editor" in the Visual C++ User's Guide.)

    – or –

    If your icon already exists (for example, as a bitmap) and you want to import it, not draw it, select Resource from the Insert menu, then select Import from the buttons in the Resource dialog. You will be prompted for the file containing your icon.

  3. Name the icon. The frame window's icon must have the name "frameicon," and the child window's icon must have the name "childicon." These names must be entered as strings into the Icon Properties dialog box.

    To display the Icon Properties dialog box, double-click in the icon editor area outside the icon's grid or press ALT+ENTER.

    In the ID field on the General tab of Icon Properties dialog box, type over the default icon name with "frameicon" or "childicon." You must add the quotation marks to the text you type in order to make the name be interpreted as a string.

    Your icon will be saved in a file with the extension .ICO.

  4. Create a script file to hold your icons. Select File/Save As. You will be prompted for the name of the script file that will contain your icons. Name the script file. It must end with the extension .RC; for example, myicons.rc. Using this method, the icons and their string values will be automatically saved in the script file. (Alternatively, you can create a script file with any editor and add the icon names and their string values by hand.)

  5. Add the script file to the project that contains your QuickWin application. Select Build and the script file will be built into the application's executable. (The compiled script file will have the extension .RES.)

When you run your application, the icon you created will take the place of the default child or frame icon. Your custom icon appears in the upper-left corner of the window frame. When you minimize the window, the icon appears on the left of the minimized window bar.