Important: The information in this document is obsolete and should not be used for new development.
GetSpecificHighLevelEvent
You can use theGetSpecificHighLevelEventfunction to select and optionally retrieve a specific high-level event from your application's high-level event queue.
FUNCTION GetSpecificHighLevelEvent (aFilter: GetSpecificFilterProcPtr; yourDataPtr: UNIV Ptr; VAR err: OSErr): Boolean;
aFilter- Specifies the filter function that
GetSpecificHighLevelEventshould use to search for a specific event.GetSpecificHighLevelEventcalls your filter function once for each event in your application's high-level event queue until your filter function returnsTRUEor the end of the queue is reached.yourDataPtr- Specifies the criteria your filter function should use to select a specific event. For example, in the
yourDataPtrparameter you can specify a reference constant to search for a particular event, a pointer to a target ID record to search for a specific sender of an event, or an event class to search for a specific class of event.errGetSpecificHighLevelEventreturns in this parameter a value indicating if any errors occurred. Theerrparameter contains thenoErrconstant if no errors occurred ornoOutstandingHLEif no high-level events are pending in your application's high-level event queue.DESCRIPTION
You can use theGetSpecificHighLevelEventfunction to search for a specific high-level event in your application's high-level event queue. You provide a pointer to a filter function as one of the parameters toGetSpecificHighLevelEvent. TheGetSpecificHighLevelEventfunction calls your filter function once for every event in your application's high-level event queue, until your filter function returnsTRUEor the end of the queue is reached.The
GetSpecificHighLevelEventfunction passes the value you specify in theyourDataPtrparameter to your filter function. Your filter function also receives as parameters the event record associated with the high-level event and the target ID record that identifies the sender of the event. Your filter function can compare the contents of theyourDataPtrparameter with any of the other information it receives.If your filter function finds a match, it can call
AcceptHighLevelEventif necessary, and then returnTRUE. If your filter function does not find a match, then it should
returnFALSE.If your filter function returns
TRUE, theGetSpecificHighLevelEventfunction returnsTRUE. If your filter function returnsFALSEfor all high-level events in your application's event queue, or if there are no high-level events in the queue,GetSpecificHighLevelEventreturnsFALSE.SPECIAL CONSIDERATIONS
TheGetSpecificHighLevelEventfunction may move or purge memory. You
should not call this function from within an interrupt, such as in a completion routine
or VBL task.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetSpecificHighLevelEvent
function are
Trap macro Selector _OSDispatch $0045 SEE ALSO
See "Filter Function for Searching the High-Level Event Queue" on page 2-114 for more information about how to define a filter function and the parameters thatGetSpecificHighLevelEventpasses to your filter function.