Win32 Resource Loading Sample

This sample is located in \Samples\Windows\Win32ResSupport.

Description
Using the Sample
Key Project Files
Technologies Demonstrated

Description

The Microsoft virtual machine (Microsoft VM) supports the Microsoft® Win32® resource file (.res) format, which allows you to use existing Win32 programming and localization tools to develop and globalize Java applications. This example shows how to use the supported Win32 resource styles and controls included with the com.ms.ui.resource.Win32ResourceDecoder class.

The example uses a single, merged, multilingual resource file (Strtable.res) that contains English, German, and Japanese resources. Developers use such files to create multilingual applications. You can use the resmerge utility, found in the %SDKDIR%\Bin directory, to add other language resources. (The resmerge command in Merge.bat shows you how to merge the files.). The Win32ResourceDecoder object automatically detects and downloads the correct language resource based on the default system locale, and displays dialogs using default system fonts.

This example also provides English (Strtable_en.res), Japanese (Strtable_jp.res), and German (Strtable_de.res) resource files. If you want to use one language .res file instead of the merged version, rename the selected .res file to Strtable.res.

Using the Sample

To compile the sample

Use Nmake.exe to compile makefile in the \Samples\Windows\Win32ResSupport directory.

To run the sample

Use the following command to run the sample:

jview GuiApp

The sample displays a dialog box with a set of tabbed pages and each page shows a set of user interface elements (button styles, combo box styles, static controls, and so on). If you run the sample with a localized version (Japanese or German) of Microsoft® Windows® platform, dialog boxes will appear in the appropriate language.

Key Project Files

GuiApp.java

This class extends UIApplet and implements Runnable. It creates the GuiApp application, which demonstrates Win32 user interface controls grouped on property pages.

merge.bat

This batch file runs the resmerge utility to combine resource files.

strtable_en.res, strtable_jp.res, strtable_de.res, and strtable.res files

English, Japanese, German, and combined resource files.

Technologies Demonstrated

AFC

Resmerge Tool

Internationalization

© 1999 Microsoft Corporation. All rights reserved. Terms of use.