Sweden-Number/library
Alexandre Julliard da0cfb3610 Release 961201
Sat Nov 30 19:21:17 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [configure]
	Re-generated with autoconf 2.11. Let me know if you have
	problems.

	* [controls/listbox.c] [controls/oldlbox.c]
	Listboxes rewritten from scratch. Moved old code still used by
	comboboxes to oldlbox.c

	* [misc/registry.c]
	Use temporary file when saving registry.

	* [windows/dialog.c]
	Implemented Win32 version of DlgDirList() and DlgDirListComboBox().

	* [windows/winproc.c]
	Added translation for listbox Win32 messages.

Sat Nov 30 21:00:00 Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [controls/widgets.c] [controls/button.c]
	Fixed some incompatibilities with CTL3D DLL.

	* [windows/dialog.c]
	Made dialog windows fit into the desktop.

	* [misc/winsock.c] [misc/winsock_async.c]
	New Winsock engine.

	* [windows/message.c]
	GetMessage() fixes.

	* [windows/queue.c] [windows/hook.c] [windows/win.c]
	SetMessageQueue() fixes.

Fri Nov 29 10:25:12 1996  Slaven Rezic  <eserte@cs.tu-berlin.de>

	* [objects/text.c]
	DrawText16(): Fixed return value.

Tue Nov 26 14:47:09 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [files/profile.c] [*/*]
	Added Win32 profile functions, updated to new naming standard.

	* [objects/font.c] [if1632/thunk.c] [include/windows.h]
	Added EnumFonts32*, EnumFontFamiliesEx*, changed prototypes and
	structures.

	* [misc/ole2nls.c] [if1632/thunk.c]
	Added EnumSystemLocales() (winhelp.exe).

	* [misc/registry.c]
	Added Windows 3.1 registry loader supplied by Tor Sjxwall, tor@sn.no

	* [win32/file.c]
	Partially fixed CreateFileMapping(), added UnmapViewOfFile().

Sat Nov 23 23:36:05 1996  Ronan Waide  <waider@waider.ie>

	* [misc/shell.c]
	Fixed some FIXMEs relating to ShellExec() and FindExecutable().

	* [misc/main.c]
	Implemented a few more of the SystemParametersInfo() cases.

Tue Nov 19 01:24:34 1996  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [include/keyboard.h]
	New file, new macro WINE_VKEY_MAPPINGS (using code taken from event.c).

	* [include/windows.h]
	New [VK_A, VK_Z] and [VK_0, VK9] macros.

	* [misc/keyboard.c]
	Fixes in KeyTable and ToAscii.

	* [objects/font.c]
	FONT_init : Give default value for MSWIN "system" font.
	FONT_MatchFont : Do not try every size of a font family if the
	family does not exist.

	* [windows/event.c]
	lastEventChar hack removed.
	KeyStateTable replaced by InputKeyStateTable (maintained in event.c)
	and QueueKeyStateTable (maintained in message.c).
	EVENT_key : Corrections to the extended bit setting.

	* [windows/message.c] [windows/keyboard.c]
	Implementation of a new QueueKeyStateTable : table of key states
	valid when messages are retrieved by GetMessage or PeekMessage,
	and valid for TranslateMessage.
	TranslateMessage : Convert WM*KEY messages using QueueKeyStateTable
	and ToAscii.
	
Mon Nov 18 16:59:01 1996  Robert Pouliot <krynos@clic.net>

	* [graphics/Makefile.in] [graphics/wing.c]
	  [if1632/wing.spec]
	Some functions for WinG support, mostly empty stubs.

	* [misc/crtdll.c] [if1632/crtdll.spec]
	Many functions added to CRTDLL, mostly calls to Unix C library.
1996-12-01 17:17:47 +00:00
..
Makefile.in Release 961013 1996-10-13 17:45:47 +00:00
README.resources Release 951226 1995-12-26 15:05:24 +00:00
arch.c Release 951226 1995-12-26 15:05:24 +00:00
libres.c Release 961117 1996-11-17 18:59:11 +00:00
miscstubs.c Release 961201 1996-12-01 17:17:47 +00:00
sup.c Release 960805 1996-08-05 17:42:43 +00:00
winestub.c Release 960712 1996-07-12 19:02:39 +00:00
winmain.c Release 961013 1996-10-13 17:45:47 +00:00

README.resources

This is a short discussion of resources in WineLib.

Introduction
Resources are used to store dialogs, menus, bitmaps, icons, 
version information, strings, fonts, and accelerators.
In a Win3.1 programming environment, there are three file formats for 
resources:
- the RC script, which is human-readable and can be processed by a resource
compiler
- the .RES file, which is the output of the resource compiler
- the .EXE and .DLL files, which store resources as a part of the NE
file format
For WineLib, only a part of this is supported. In particular, there is no
.RES file, the executable is not a NE file (as it is a native Unix executable),
and some resource types are not implemented: icons, version information,
strings, and fonts.

Building a WineLib application
The build process assumes that the C source files and the resource script
is available. At the moment, a single resource script is recommended.
This script is processed by winerc:
1) the preprocessor is used to resolve symbolic style name (LBS_STANDARD, ...)
into numbers. This involves processing windows.h
2) the unused parts of windows.h (type definitions) are removed. This would
not be necessary if Wine's windows.h would use the RC_INVOKED macro.
3) winerc is invoked to create a binary representation of the resources.
This representation is stored as C source code (arrays).
4) gcc is used to compile the generated C code.
Now, each resource is available as a C array to the application. As the 
executable is not in the NE format, it is not possible to retrieve resource
locations in the executable via name. Instead, the resources have to be
referenced with their generated C array names. The linker then resolves
these names in the compiled resource file.
5) The program sources are compiled and linked with the output of step 4.
A sample build process is in toolkit/Makefile:hello3.

Required changes to the program sources
Because loading the resources from an instance handle is not possible,
the *Indirect functions have to be used to load a resource. The C arrays
can be directly passed to the *Indirect functions. So, instead of writing

	hMenu=LoadMenu(hInstance,"MAIN");

write

	hMenu=LoadMenuIndirect(hello3_MENU_MAIN.bytes);

Fortunately, the Windows API has the following functions available:
DialogBoxIndirect
CreateDialogIndirect
DialogBoxIndirectParam
CreateDialogIndirectParam

LoadMenuIndirect
SetDIBitsToDevice

Sample code is available in hello3.c. hello3res.c contains the corresponding
resources.

Keeping a common source
Clearly, changing the sources is not very desirable, and suggestions how
to reduce the amount of work are welcome. In the meantime, two approaches
allow at least to remain a common source between the Win3.1 code and the
WineLib code:
1) conditional compiles:
When compiling a WineLib application, WINELIB is defined. This can be used
to select Wine-specific code.
2) usage of winerc for Windows: The *Indirect functions are available on
plain Win3.1, and the resource format is fully compatible. Thus, recompiling
sources modified for WineLib on Win3.1 is possible and known to work.

Open problems
1) Icons and cursors: For these resources, there is no *Indirect function
documented. In addition, both are implemented by a set of two resources.
This is the reason why they are not supported by winerc.
2) Accelerators: Although winerc supports accelerators, there is no 
LoadAcceleratorIndirect function. A work-around would be to define one.
3) Fonts: Font resources are not supported by Wine at all.
4) String tables: Although string tables are not supported by winerc, there
is no reason not to add such support. Again, some indirect loading would
be necessary.
5) API requires loading by name: At some places, the name of a resource
is passed instead of a handle. The WNDCLASS structure contains the name
of a menu resource, and the icon in a dialog box is referenced by its name.
(Are there some more places?)
Clearly, loading the resource by name would be highly desirable. The
resource compiler currently creates a structure containing all resources
defined in an RC file. However, it is not clear how WINELIB could find the
location of this structure, especially, when there is more than one RC file.