FaxClose function

Applies to: desktop apps only

The FaxClose function closes the following types of fax handles:

Syntax

BOOL WINAPI FaxClose(
  __in  HANDLE FaxHandle
);

Parameters

FaxHandle [in]

Type: HANDLE

Specifies the fax handle to close. This value can be a fax server handle returned by a call to the FaxConnectFaxServer function, or a fax port handle returned by a call to the FaxOpenPort function.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError can return one of the following errors.

Return codeDescription
ERROR_ACCESS_DENIED

Access is denied. FAX_PORT_QUERY access is required.

ERROR_INVALID_HANDLE

The FaxHandle parameter is invalid.

 

Remarks

A fax client application must call the FaxClose function as the last function before it terminates. The CloseHandle function cannot close the handle to a fax server or a fax port.

When the FaxClose function closes a handle allocated by the FaxConnectFaxServer function, the function disconnects the calling application from the specified fax server.

A fax client application continues to receive fax events from the fax service after the application successfully calls the FaxClose function to close a fax server handle. This permits the fax service to shut down and conserve system resources when the service has been idle for an extended period. If you keep the handle to the fax server open, the fax service does not shut down.

For more information, see Enabling an Application to Receive Notifications of Fax Events, Connecting to a Fax Server and Disconnecting from a Fax Server, and FaxInitializeEventQueue.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winfax.h

Library

WinFax.lib

Unicode and ANSI names

FaxCloseW (Unicode) and FaxCloseA (ANSI)

See also

Fax Service Client API for Windows 2000
Fax Service Client API Functions
FaxConnectFaxServer
FaxOpenPort

 

 

Build date: 5/5/2012

Community Additions

ADD
Show: