<< Click to Display Table of Contents >>
ZfxGetUserFromname
Get user's default sender name.
Syntax
ZFERR FAR ZfxGetUserFromname( ZFSESSIONHANDLE hSession, char FAR *lpszBuffer, short BufLen)
Parameters
Parameter |
Description |
hSession |
API session handle, as returned by ZfxAPIInit calllpszBufferAddress of buffer used to return the full path of the directory, including a terminating backslash ('\') and NULL. |
BufLen |
Size of the buffer (including space for the terminating NULL) |
Description
This routine returns the default setting for the sender name for messages submitted by this user (usually their full name). When a new user is created the sender name is set to the full name entered in the Zetafax Configuration program, but the user can then change it using the Zetafax client. Note that editing an existing user in the Setup program does not change the sender name.
The routine need only be called if the program wants to perform specific processing on the name (for example, overriding it if blank), as the default will automatically be used if the "From:" line is omitted from a SUBMIT file.
Sender names have a maximum length of ZFMSG_FULLNAME_LEN (excluding space for the terminating NULL).
Return Value
The routine returns 0 if successful, otherwise one of the following:
ZFERR_NOT_INITIALISED
ZFERR_BUFFER_TOO_SMALL
Example
#include <stdio.h>
#include <zfapi.h>
...
szFromname[ZFMSG_FULLNAME_LEN+1];
if (ZfxGetUserFromname(hSession, szFromname, sizeof(szFromname)) != 0
|| szFromname[0] =='\0') /* if no default name set */
{
/* force a default name */
strcpy(szFromname, "Fax Administrator");
}
Related topics