_DeActivateHandler( ) (Rutina de biblioteca API)

_DeActivateHandler( ) quita el controlador de eventos especificado de la lista de procesadores de eventos.

void _DeActivateHandler(unsigned int EventIdentifier)
unsigned int EventIdentifier;      /* ID of event handler
 to be removed from list. */

Observaciones

Es necesario quitar todos los controladores de eventos, indicados por EventIdentifier, de la lista de controladores cuando la biblioteca se descarga.

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 ejemplo siguiente activa un controlador de eventos cuando se carga la biblioteca. El controlador de eventos imprime un mensaje para cada evento y permite a Visual FoxPro procesar el mensaje. El controlador de eventos se desactiva cuando se descarga la biblioteca. Como ocurre en el siguiente ejemplo, _DeActivateHandler( ) se suele llamar desde una función CALLONUNLOAD.

Código Visual FoxPro

SET LIBRARY TO DEACTHAN

Código C

#include <pro_ext.h>

static int HandlerID;

//   This is the routine that is registered as an event handler.
FAR EventHandler(WHandle theWindow, EventRec FAR *ev)
{
   _PutStr("\nEventHandler() called.");
   return NO;   // event still needs to be handled by Visual FoxPro
}

FAR Activate()
{
   HandlerID = _ActivateHandler(EventHandler);
}

//   When the library is unloaded we must deactivate the event handler
//   in a CALLONUNLOAD function.
FAR DeActivate()
{
   _DeActivateHandler(HandlerID);
}

FoxInfo myFoxInfo[] = {
   {"ACTIVATE",  (FPFI) Activate, CALLONLOAD, ""},
   {"DEACTIVATE", (FPFI)  DeActivate, CALLONUNLOAD, ""}
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

Vea también

_ActivateHandler( ) (Rutina de biblioteca API) | _FindWindow( ) (Rutina de biblioteca API) | _GlobalToLocal( ) (Rutina de biblioteca API) | _MousePos( ) (Rutina de biblioteca API)