Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  
  Windows uses the term resources to mean things like dialogs,
  accelerators, icons, bitmaps, brushes, menus, cursors and
  strings.  There are quite a number of pre-defined resources,
  such as different cursor shapes, but a program can create and
  use its own resources as well.
  
  Furthermore, a program can create resources as it runs, or
  resources can be stored in the EXE file and fetched from it.
  They can also be stored in a DLL and fetched from there (this
  follows easily, because the two types of file are nearly
  identical internally).
  
  As well as the pre-defined resources, Clip-4-Win supports both
  dynamic resources (i.e. created as the program runs) and
  resources fetched from an EXE or DLL.  The source\dialog.prg
  sample shows a resource-only DLL being used.  An "empty"
  resource-only DLL is provided in the dll\ directory, which you
  can copy and add your own resources to if you wish.
  
  Dynamic resources and resources stored in files each have
  advantages and disadvantages.  For example, using dynamic
  resources keeps the code and data concerned together.  This is
  not terribly important for code which is not initimately
  affected by the resource, as code using a specific cursor is
  unlikely to be.  But some code is tied ("tightly coupled") to
  the data.  This is the case for both dialogs and menus.  With
  dialogs and menus, any change to their structure requires a
  corresponding change to the structure of the code.
  
  On the other hand, some changes do not require changes in the
  corresponding code.  Typically, these are changes in position
  or size of the visual interface, e.g. the placement of
  buttons.
  
  Of course, if you want to keep code and data together there's
  nothing to stop you using a visual editor and then editing the
  result to a PRG.
  
  There are a number of visual tools that can be used to help
  design resources, including dialog editors, bitmap editors,
  and icon editors.  These tools are supplied with various
  Microsoft products (including the SDK and Visual C++).  Also
  Borland products often include them, or you can buy them
  separately (e.g. the Whitewater Resource Toolkit).  There are
  a number of public domain tools, too.
  
  Frequently, these visual tools can output an ASCII text file
  (a .rc, .dlg, or whatever), and/or a binary (.res) file.  Some
  of the tools can work directly on the EXE file, and others
  rely on a resource compiler (e.g. Microsoft's rc.exe).
  
  As an example, Microsoft's resource compiler can be used to
  compile a .rc file into a .res file:
                 rc -r file.rc
  and can also be used to add the file to an EXE:
                 rc -k file.res myapp.exe
  
  If you have any visual tools or a resource compiler and need
  information about using them, you should refer to their
  documentation.
  
  Once stored in an EXE (or DLL), resources are identified
  either by name or numeric id.  The LoadXXX() functions
  generally need a handle to the instance of the file holding
  the resource, and the resource name or id.  (The instance
  handle defaults to the currently running EXE.)
  
  Note that Clip-4-Win allows a menu item to specify a code
  block that is run if the item is selected.  This is a more
  powerful mechanism than is supported by a menu resource, and
  consequently using menus in resource files is not recommended.
  
  If you're using Borland's Resource Workshop (e.g. 1.02), you
  should not #include "windows.ch", because it already knows the
  definitions.  See dialog.rc for an example that uses #ifndef
  WORKSHOP_INVOKED to detect which resource tool is being used.
  
  

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson