Compartir a través de


_GetNextEvent( ) API Library Routine

Reads the next event into the EventRec and returns the event type.

int _GetNextEvent(EventRec FAR *event)
EventRec FAR *event;   /* Event. */

Remarks

Null events are generated when no other activity has taken place. Idle routines shouldn't call _GetNextEvent( ). You can call _GetNextEvent( ) from an event handler but you must be careful, because _GetNextEvent( ) calls the event handler recursively.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example is a loop consisting of a call to _GetNextEvent( ), followed by a call to _DefaultProcess( ). All events during this procedure receive their default processing.

Visual FoxPro Code

SET LIBR TO GETNXEV

C Code

#include <pro_ext.h>

FAR Example(ParamBlk FAR *parm)
{
   EventRec ev;
   int i;

   for (i = 0; i < 16; i++) {
      _GetNextEvent(&ev);
      _DefaultProcess(&ev);
   }
}
FoxInfo myFoxInfo[] = {
   {"ONLOAD", Example, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

_ActivateHandler( ) API Library Routine | _FindWindow( ) API Library Routine | _GlobalToLocal( ) API Library Routine | _MousePos( ) API Library Routine | Accessing the Visual FoxPro API | _DefaultProcess( ) API Library Routine