#include <fte.h>
XFNOTIFYPROC xfNotifyProc(hSession, hConnection, dwNotificationCode, dwParam)
HSESSION hSession; /* handle of session in which event occurred */
HCONNECTION hConnection; /* handle of connection in which event occurred */
DWORD dwNotificationCode; /* code specifying which event occurred */
DWORD dwParam; /* parameter for notification code */
xfNotifyProc is an application-defined call-back function for file transfer events.
Parameters
hSession
Provides a session to the xfNotifyProc routine.
hConnection
Provides a connection to the xfNotifyProc routine.
dwNotificationCode
Specifies the file transfer event that occurred.
Value | Meaning |
XFN_CONNECTION_ABORT | Connection abnormally terminating. |
XFN_CONNECTION_END | Connection normally closing. |
XFN_CONNECTION_START | Connection starting. |
XFN_FILE_ABORT | File transfer abnormally terminating. |
XFN_FILE_BLOCK | Transfer of one block of data complete. |
XFN_FILE_END | File transfer normally closing. |
XFN_FILE_START | File transfer starting. |
XFN_TRANSFER_ABORT | Transfer abnormally terminating. |
XFN_TRANSFER_ACCEPT | The receiver is notified that transfer is accepted. An application should call xfReceive to start receiving files. |
XFN_TRANSFER_CONFIRMED | The sender is notified that the transfer is confirmed. |
XFN_TRANSFER_DECLINE | The sender is notified that the transfer is declined. |
XFN_TRANSFER_END | Transfer normally closing. |
XFN_TRANSFER_START | Transfer starting. |
XFN_TRANSFER_REFUSE | The receiver is notified that the current application declined the transfer. |
XFN_UI_CONNECT | User interface connect notification. |
XFN_UI_CONFIRMTRANSFER | Transfer about to start. This is the point at which to prompt the user to confirm acceptance through a message box. |
XFN_UI_DISCONNECT | User interface disconnect notification. |
XFN_UI_TRANSFER | User interface transfer notification. |
dwParam
Specifies a parameter for event corresponding to dwNotificationCode.
Value | Meaning | |
XF_UI_ERROR | Error occurred during operation. Application normally creates dialog here. | |
XF_UI_PROGRESS | Update progress of operation. | |
XF_UI_START | Started operation. Application normally creates dialog here. xfDefNotifyProc can create dialog. | |
XF_UI_STOP | Finished operation. |
xfDefNotifyProc will create the progress dialog when it receives the XFN_UI_TRANSFER notification with a dwparam of XF_UI_START. It will update the progress indicator when it receives XF_UI_PROGRESS then it will close the dialog when it receives XF_UI_STOP.
Return Value
If the function does not handle the notification code, the value returned should be the value from xfDefNotifyProc. If the application handles all the user interface, it should not pass the XFN_UI notification codes to xfDefNotifyProc. Instead, it should return 0. When an XFN_UI_CONFIRM_TRANSFER is received, return 1 to accept the files and 0 to decline.
Comments
Pass this function to the xfInitialize function when a session is started. The file transfer engine calls the notification procedure when a file transfer event occurs. These events include ones associated with connections, transferring of files, and the user interface elements.
Applications should generally pass all notification codes on to xfDefNotifyProc. This routine should not block except when handling XF_UI_CONFIRMTRANSFER. This should instead prompt the user for acceptance of the transfer.
If an application wishes to handle its own user interface messages, it should handle all XFN_UI notification codes.
See Also
xfDefNotifyProc, xfInitialize, xfReceive