_DeActivateIdle( ) (Rutina de biblioteca API)
Quita la rutina especificada del bucle inactivo.
void _DeActivateIdle(unsigned int IdleIdentifier)
unsigned int IdleIdentifier; /* Routine to be removed
from idle list. */
Observaciones
Es necesario quitar todas las rutinas inactivas de la lista al descargar la biblioteca correspondiente.
Para obtener más información acerca de cómo crear una biblioteca API e integrarla con Visual FoxPro, vea Acceso a la API de Visual FoxPro.
Ejemplo
El siguiente ejemplo activa un controlador de eventos inactivo cuando se carga la biblioteca. El controlador de eventos inactivo se limita a imprimir un mensaje y se desactiva cuando se descarga la biblioteca. Como ocurre en el siguiente ejemplo, _DeActivateIdle( ) se suele llamar desde una función CALLONUNLOAD.
Código Visual FoxPro
SET LIBRARY TO DEACTIDL
Código C
#include <pro_ext.h>
static unsigned IdlerID;
// This is the routine that is registered as an idle event handler.
void FAR IdleHandler(WHandle wh, EventRec *ev)
{
_PutStr("\nIdleHandler() called.");
}
void FAR Activate(ParamBlk FAR *parm)
{
IdlerID = _ActivateIdle((FPFI) IdleHandler);
}
// When the library is unloaded we must deactivate the idle event
// handler in a CALLONUNLOAD function.
void FAR DeActivate(ParamBlk FAR *parm)
{
_DeActivateIdle(IdlerID);
}
FoxInfo myFoxInfo[] = {
{"ACTIVATE", (FPFI) Activate, CALLONLOAD, ""},
{"DEACTIVATE", (FPFI) DeActivate, CALLONUNLOAD, ""}
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
Vea también
_ActivateIdle( ) (Rutina de biblioteca API) | _FindWindow( ) (Rutina de biblioteca API) | _GlobalToLocal( ) (Rutina de biblioteca API) | _MousePos( ) (Rutina de biblioteca API)