The FtgRegisterIdleRoutine function adds a FNIDLE – based idle routine to the MAPI system.
Note This function may not be supported in future versions of MAPI.
Header file: | MAPIUTIL.H |
Implemented by: | MAPI |
Called by: | Client applications and service providers |
FTG FtgRegisterIdleRoutine(
PFNIDLE pfnIdle,
LPVOID pvIdleParam,
short priIdle,
ULONG csecIdle,
USHORT iroIdle
);
Priorities greater than zero represent background tasks that have a higher priority than user events and are dispatched as part of the standard Windows message pump loop. Priorities less than zero represent idle tasks that only run during message pump idle time. Examples of priorities are: 1 for foreground submission, –1 for power-edit character insertion, and –3 for downloading new messages.
The FtgRegisterIdleRoutine function returns a function tag identifying the idle routine that has been added to the MAPI system. If FtgRegisterIdleRoutine cannot register the idle routine for the client application or service provider — for example, because of memory problems — it returns NULL.
The following functions deal with the MAPI idle engine and with idle routines based on the FNIDLE function prototype:
Idle routine function | Usage |
---|---|
ChangeIdleRoutine | Changes the characteristics of a registered idle routine. |
DeregisterIdleRoutine | Removes a registered idle routine from the MAPI system. |
EnableIdleRoutine | Disables or re-enables a registered idle routine without removing it from the MAPI system. |
FtgRegisterIdleRoutine | Adds an idle routine to the MAPI system, with or without enabling it. |
MAPIDeInitIdle | Shuts down the MAPI idle engine for the calling application. |
MAPIInitIdle | Initializes the MAPI idle engine for the calling application. |
ChangeIdleRoutine, DeregisterIdleRoutine, and EnableIdleRoutine take as an input parameter the function tag returned by FtgRegisterIdleRoutine.
When all foreground tasks for the platform become idle, the MAPI idle engine calls the highest priority idle routine that is ready to execute. There is no guarantee of calling order among idle routines of the same priority.