win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinLoadMessage (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMESSAGEMGR
 
SHORT WinLoadMessage(hab, hmod, id, cchMax, pszBuffer);
HAB hab;          /* handle of the anchor block           */
HMODULE hmod;     /* module handle                        */
USHORT id;        /* message identifier                   */
SHORT cchMax;     /* buffer size                          */
PSZ pszBuffer;    /* address of buffer for message        */
 
The WinLoadMessage function loads a message from a resource, copies the
message to the specified buffer, and appends a terminating null character.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hab        Identifies the anchor block.
 
hmod       Identifies the module that contains the message. This parameter
           can be either the module handle returned by the DosLoadModule
           function or NULL for the application's module.
 
id         Identifies the message.
 
cchMax     Specifies the size of the buffer.
 
pszBuffer  Points to the buffer that receives the message.
 
Return Value
 
The return value is the length of the returned message (excluding the
terminating null character). The return value can have a maximum value of
(cchMax -1). The return value is zero if an error occurs.
 
Comments
 
Message resources contain up to 16 messages each. The resource identifier is
calculated from the id parameter value passed to WinLoadMessage as follows:
 
     resource identifier = (id / 16) + 1
 
To save storage on disk and in memory, applications should group their
message resources sequentially, starting at a multiple of 16.
 
See Also
 
DosLoadModule, WinLoadString